Area
Authentication / onboarding
Problem to solve
Summary
Replace the current custom email OTP + JWT authentication system with Clerk
to improve security, reduce maintenance overhead, and unlock features like social login,
MFA, and session management out of the box.
Current Auth System
- Custom email OTP flow via Nodemailer (Gmail App Password / OAuth2)
- JWT-based session management (
ACCESS_TOKEN secret)
- Manual token verification middleware on the Express backend
- User records stored and managed in MongoDB
Motivation
- The custom OTP + JWT setup requires ongoing maintenance and is error-prone
- Clerk provides a production-ready auth layer with better DX and security defaults
- Enables future features: Google/GitHub OAuth, MFA, user management dashboard
- Reduces environment variables and complexity (
MAIL_USER, MAIL_PASS, OAUTH_* keys can be removed)
Proposed Changes
Backend (server/)
Frontend (frontend/)
Env / Config
Out of Scope
- Migrating existing user passwords (no passwords in current system, OTP-only)
- Changing the Socket.IO presence/DM logic
References
Labels: enhancement, auth, breaking-change
Proposed solution
.
Who benefits and how?
.
Scope or acceptance criteria
.
Related files, routes, or references
.
Before submitting
Area
Authentication / onboarding
Problem to solve
Summary
Replace the current custom email OTP + JWT authentication system with Clerk
to improve security, reduce maintenance overhead, and unlock features like social login,
MFA, and session management out of the box.
Current Auth System
ACCESS_TOKENsecret)Motivation
MAIL_USER,MAIL_PASS,OAUTH_*keys can be removed)Proposed Changes
Backend (
server/)@clerk/expressand configure Clerk middlewarerequireAuth()/getAuth()ACCESS_TOKEN,MAIL_USER,MAIL_PASS,OAUTH_*env varsFrontend (
frontend/)@clerk/clerk-react<ClerkProvider><SignIn />/<SignUp />components (or use Clerk's hosted UI)useAuth()/getToken()from ClerkVITE_CLERK_PUBLISHABLE_KEYto frontend.envEnv / Config
.env.examplefor both server and frontendREADME.mdwith new setup instructionsOut of Scope
References
Labels:
enhancement,auth,breaking-changeProposed solution
.
Who benefits and how?
.
Scope or acceptance criteria
.
Related files, routes, or references
.
Before submitting