[CRM][FullStack] - Reset Password and Email Verification#305
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| @@ -0,0 +1,10 @@ | |||
| import ResetPasswordConfirm from '@/lib/components/auth/ResetPasswordConfirm'; | |||
There was a problem hiding this comment.
for verify-email / reset-password confirm / accept-invitation we keep a server page.tsx that just reads searchParams and passes them as props to the client component in lib the client side needs hooks and interactivity so it can't be the page itself, and a client page would have to use useSearchParams() which requires a boundary (next fails the prod build with Missing Suspense boundary with useSearchParams if you don't). reading params on the server avoids that
There was a problem hiding this comment.
I moved the sign in logic and state to a page hook
also added logic to handle unverified emails
| process.env.BETTER_AUTH_URL ?? | ||
| (process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : 'http://localhost:3000'); | ||
|
|
||
| const requireSignupEmailVerification = process.env.REQUIRE_EMAIL_VERIFICATION === 'true'; |
There was a problem hiding this comment.
If u want to have verification true set in .env REQUIRE_EMAIL_VERIFICATION
There was a problem hiding this comment.
Can you add this to .env.example as well? Also please add this to src/install/internal/command/templates/env.tmpl as this will redeploy our images of the install script with the new working env file for self hosting.
|
|
||
| if (didSendLink) { | ||
| return ( | ||
| <> |
There was a problem hiding this comment.
Can you use divs here and below, we don't use blank tags anywhere
| <span className="text-sarge-gray-800 font-medium"> | ||
| {verificationPendingEmail} | ||
| </span> | ||
| . Click it to finish creating your account. The link expires in 1 hour. |
There was a problem hiding this comment.
We should 'TODO' that this should be customizable in the admin panel eventually
| )} | ||
| /> | ||
| return ( | ||
| <> |
| const { form, hasUnsavedChanges, fieldsLocked, authReady, handleSaveProfile, handleSignOut } = | ||
| useProfilePage(); | ||
|
|
||
| const [changePasswordOpen, setChangePasswordOpen] = useState(false); |
There was a problem hiding this comment.
Want to move this in useProfilePage as well?
| process.env.BETTER_AUTH_URL ?? | ||
| (process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : 'http://localhost:3000'); | ||
|
|
||
| const requireSignupEmailVerification = process.env.REQUIRE_EMAIL_VERIFICATION === 'true'; |
There was a problem hiding this comment.
Can you add this to .env.example as well? Also please add this to src/install/internal/command/templates/env.tmpl as this will redeploy our images of the install script with the new working env file for self hosting.
| ], | ||
|
|
||
| // Allow apostrophes in JSX text "you're" instead of having to do "you're" | ||
| 'react/no-unescaped-entities': [ |
| } | ||
|
|
||
| toast.success( | ||
| `We sent a verification link to ${values.email}. Click it to finish updating your email.` |
There was a problem hiding this comment.
I say remove the second sentence for now. This can be changed later but I think it is intuitive of what they need to do next given they've verified their email once already
- Introduced email verification functionality during signup and email change processes. - Added a new template for email verification HTML. - Updated auth configuration to include email verification settings and methods for sending verification emails.
…ks up the frontend for verifying emails
- Implemented a Change Password modal component for password updates - Created a hook to manage the password change logic
…'t have to rewrite the left gradient :/
…s and frontend (where invites are involved) now we use a two type convention since the better auth api was specific in what it returned for accept invite (created At specifically)
…p of button semantic html introduced in the earlier days of dev
3ed1562 to
08799ee
Compare
get rid of fragments add todo add to .env example and self hosting new env var
08799ee to
17febfb
Compare
[CRM][FullStack] - Reset Password and Email Verification
reset password flow - user clicks reset password bring them to the reset password page - they enter the email - if the email is linked to an account the email is sent with a link that has a token (the token is valid for one hour) after clicking the link they can input a password meeting the criteria we've set for sign up and reset the password - after doing this they'll then be taken back to the sign in screen
change password flow
change email flow
a bunch of fixes to be more consistent with the design tokens and systems
updated the primatives
Added a new config env to .env REQUIRE_EMAIL_VERIFICATION - if u want to have email verification - so for testing staging and local u might not want to have this but for prod we'd want to - so I need to config this for staging and prod
Screenshots
The user clicks this verify email then is redirected to
changing email and password

Screen.Recording.2026-06-12.at.7.19.26.PM.mov
Checklist
Please go through all items before requesting reviewers:
Closes
Closes #303