You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Implement OTP email verification and unverified user restrictions
- Added OTP generation and email sending service (using Resend)
- Implemented `/send-otp` and `/verify-otp` backend endpoints
- Added [OtpVerification](cci:1://file:///e:/Majors/urBackend/frontend/src/pages/OtpVerification.jsx:7:0-175:1) frontend page with auto-send and skip functionality
- Updated Signup flow to redirect to OTP verification
- Updated Login to store verification status
- Added access restrictions for unverified users (Create Project, Create Collection, Storage)
- Updated Settings page to show verification status and "Verify Now" option
- Fixed module syntax in emailService and implemented token refresh on verification
if(!apiKey)returnres.status(401).send('API key not found');
7
+
if(!apiKey)returnres.status(401).json({error: 'API key not found'});
8
8
9
-
constproject=awaitProject.findOne({ apiKey });
10
-
if(!project)returnres.status(401).send('Invalid API key');
9
+
constproject=awaitProject.findOne({ apiKey })
10
+
.populate('owner','isVerified');
11
+
if(!project)returnres.status(401).json({error: 'Invalid API key'});
11
12
13
+
if(!project.owner.isVerified)returnres.status(401).json({error: 'Owner not verified',fix: 'Verify your account on https://urbackend.bitbros.in/dashboard'});
0 commit comments