Skip to content

feat: Require email verification after signup to restrict access (#371) - #387

Open
Aryanbuha890 wants to merge 13 commits into
Muskankr:mainfrom
Aryanbuha890:371-email-verification
Open

feat: Require email verification after signup to restrict access (#371)#387
Aryanbuha890 wants to merge 13 commits into
Muskankr:mainfrom
Aryanbuha890:371-email-verification

Conversation

@Aryanbuha890

Copy link
Copy Markdown
Contributor

Description

This PR resolves #371 by adding an email verification step after user signup. Logged-in users who are not yet verified will have restricted access until they verify their email.

Changes Made

1. Database & Model Changes

  • Added a UserProfile model containing an is_verified boolean field (linked one-to-one with standard User).
  • Configured a Django signal post_save receiver to automatically create user profiles for new signups.
  • Generated database migration 0006_userprofile.

2. Backend Views & Endpoint Verification

  • Modified SignupSerializer to require a unique email on registration.
  • Subclassed JWT's TokenObtainPairSerializer to return verification claims inside login tokens and responses.
  • Updated the signup view to sign a verification token (using Django TimestampSigner) and output/send the link.
  • Added API endpoints for email verification, status verification, and resending links.
  • Protected all authenticated workspace routes (upload, history, compare) with custom verification checks, rejecting requests with HTTP 403.

3. Frontend States & Dashboard UX

  • Updated useAuth.ts to manage email registration parameters and handle periodic status verification polling.
  • Exposed the email field inside AuthModal.tsx during signup.
  • Created VerifyEmailPage.tsx to process the cryptographically signed token and output success/failure feedback.
  • Rendered an orange warnings banner at the top of the app to resend verification link, and blurred out/overlayed the resume analyzer form with a lock layout for unverified users.

Verification Results

  • Database migrations successfully applied.
  • All 27 unit tests passed successfully:
    Ran 27 tests in 12.162s
    OK

@Aryanbuha890
Aryanbuha890 requested a review from Muskankr as a code owner July 25, 2026 03:54
@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

@Aryanbuha890 is attempting to deploy a commit to the a2521729-9889's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Aryanbuha890

Copy link
Copy Markdown
Contributor Author

@Muskankr Please review this and check it.

@Muskankr

Copy link
Copy Markdown
Owner

@Aryanbuha890 , Please resolve CI failing issue as it will cause deployment fail after merge.

@Aryanbuha890

Copy link
Copy Markdown
Contributor Author

@Aryanbuha890 , Please resolve CI failing issue as it will cause deployment fail after merge.

@Muskankr Please now see, I resolve the all errors.

@Muskankr

Copy link
Copy Markdown
Owner

@Aryanbuha890 , Still merge conflicts and ci failing

@Aryanbuha890
Aryanbuha890 force-pushed the 371-email-verification branch from ad2ed42 to b8d673d Compare July 25, 2026 18:31
@Aryanbuha890

Copy link
Copy Markdown
Contributor Author

@Aryanbuha890 , Still merge conflicts and ci failing

I have done it.
image
Please check now

@Aryanbuha890

Copy link
Copy Markdown
Contributor Author

@Muskankr Please check it these.

@Muskankr

Copy link
Copy Markdown
Owner

@Aryanbuha890 , resolve conflicts!

@Aryanbuha890
Aryanbuha890 force-pushed the 371-email-verification branch from 361a788 to 4f21d03 Compare July 27, 2026 05:17
@Muskankr

Copy link
Copy Markdown
Owner

@Aryanbuha890 , Still merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add email verification step after signup

3 participants