Skip to content

[CRM][FullStack] - Reset Password and Email Verification#305

Merged
bderbs30 merged 14 commits into
mainfrom
303/reset-pass-and-email-verif
Jun 23, 2026
Merged

[CRM][FullStack] - Reset Password and Email Verification#305
bderbs30 merged 14 commits into
mainfrom
303/reset-pass-and-email-verif

Conversation

@bderbs30

@bderbs30 bderbs30 commented May 27, 2026

Copy link
Copy Markdown
Collaborator

[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


image image

The user clicks this verify email then is redirected to

image

changing email and password
image

Screen.Recording.2026-06-12.at.7.19.26.PM.mov
image image image image image

Checklist

Please go through all items before requesting reviewers:

  • All commits are tagged with the ticket number
  • No linting errors / newline warnings
  • All code follows repository-configured formatting
  • No merge conflicts
  • All checks passing
  • Screenshots included for UI changes
  • Remove non-applicable sections of this template
  • PR assigned to yourself
  • Reviewers requested & Slack ping sent
  • PR linked to the issue (fill in 'Closes #')
  • If design-related, notify the designer in Slack

Closes

Closes #303

@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sarge Ready Ready Preview, Comment Jun 19, 2026 2:27am

Request Review

@bderbs30 bderbs30 marked this pull request as draft May 27, 2026 02:09
@bderbs30 bderbs30 changed the title 303/reset pass and email verif [CRM][FullStack] - Reset Password and Email Verification May 27, 2026
@bderbs30 bderbs30 requested a review from LOTaher June 12, 2026 23:25
@bderbs30 bderbs30 marked this pull request as ready for review June 12, 2026 23:25
@@ -0,0 +1,10 @@
import ResetPasswordConfirm from '@/lib/components/auth/ResetPasswordConfirm';

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

https://arc.net/l/quote/rlpgzmxj

@bderbs30 bderbs30 Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the sign in logic and state to a page hook

also added logic to handle unverified emails

Comment thread src/lib/auth/auth.ts
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';

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If u want to have verification true set in .env REQUIRE_EMAIL_VERIFICATION

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (
<>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use divs here and below, we don't use blank tags anywhere

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yessir

<span className="text-sarge-gray-800 font-medium">
{verificationPendingEmail}
</span>
. Click it to finish creating your account. The link expires in 1 hour.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should 'TODO' that this should be customizable in the admin panel eventually

Comment thread src/app/(web)/(auth)/signup/page.tsx Outdated
)}
/>
return (
<>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

div this please!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oop yes

Comment thread src/app/(web)/crm/profile/page.tsx Outdated
const { form, hasUnsavedChanges, fieldsLocked, authReady, handleSaveProfile, handleSignOut } =
useProfilePage();

const [changePasswordOpen, setChangePasswordOpen] = useState(false);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to move this in useProfilePage as well?

Comment thread src/lib/auth/auth.ts
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';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread eslint.config.mjs
],

// Allow apostrophes in JSX text "you're" instead of having to do "you&apos;re"
'react/no-unescaped-entities': [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat

Comment thread src/lib/hooks/useProfilePage.ts Outdated
}

toast.success(
`We sent a verification link to ${values.email}. Click it to finish updating your email.`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

bderbs30 added 13 commits June 18, 2026 22:16
- 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.
- Implemented a  Change Password modal component for  password updates
- Created a  hook to manage the password change logic
…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
@bderbs30 bderbs30 force-pushed the 303/reset-pass-and-email-verif branch from 3ed1562 to 08799ee Compare June 19, 2026 02:24
get rid of fragments

add todo

add to .env example and self hosting new env var
@bderbs30 bderbs30 force-pushed the 303/reset-pass-and-email-verif branch from 08799ee to 17febfb Compare June 19, 2026 02:25
@bderbs30 bderbs30 merged commit 5f63424 into main Jun 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CRM][Fullstack] - Reset Password + Email Verification

2 participants