Skip to content

feat(auth): implement OTP-based authentication MVP#55

Merged
AYUSHDAS0601 merged 4 commits into
AYUSHDAS0601:mainfrom
Aqsa30nz:feat/auth-login-51
Jun 12, 2026
Merged

feat(auth): implement OTP-based authentication MVP#55
AYUSHDAS0601 merged 4 commits into
AYUSHDAS0601:mainfrom
Aqsa30nz:feat/auth-login-51

Conversation

@Aqsa30nz

Copy link
Copy Markdown
Contributor

Summary

Implements the MVP OTP-based authentication flow and integrates the frontend /auth page with backend authentication endpoints, providing a complete end-to-end login experience using phone number verification.

Changes

Backend

  • Added POST /auth/otp/request
  • Added POST /auth/otp/verify
  • Generate 6-digit OTPs for authentication
  • Store OTPs with expiration timestamps
  • Validate the latest unused OTP for a phone number
  • Mark OTPs as used after successful verification
  • Automatically create a user on first successful login
  • Generate JWT access tokens after authentication
  • Return authenticated user details in the response

Frontend

  • Implemented OTP authentication page at /auth
  • Added phone number submission flow
  • Added OTP verification flow
  • Integrated frontend with backend authentication endpoints
  • Store JWT token in localStorage after successful login
  • Added authentication status indicator in the navbar
  • Added logout functionality
  • Added error handling for invalid OTPs and failed requests

Tested

Success Cases

  • OTP request endpoint returns a valid response
  • OTP verification successfully authenticates users
  • JWT token is returned after successful verification
  • New users are automatically created on first login
  • User login state persists via localStorage
  • Logout removes stored authentication data and updates the UI

Failure Cases

  • Invalid OTP
  • Expired OTP
  • Missing phone number
  • Missing OTP
  • Backend request failures

Impact

  • Provides a complete end-to-end OTP authentication flow
  • Enables seamless frontend and backend authentication integration
  • Establishes JWT-based session handling for authenticated users
  • Removes dependency on password-based authentication for MVP scope
  • Creates a foundation for future protected features such as wishlists, bookings, and user-specific actions

Fixes #51

Aqsa30nz added 2 commits June 12, 2026 21:17
- Implement OTP request and verification flow
- Issue JWT token on successful OTP verification
- Add dev OTP login for testing
- Remove password-based login from runtime flow
- Align backend authentication with OTP-first approach
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

@Aqsa30nz is attempting to deploy a commit to the Ayush Das' projects Team on Vercel.

A member of the Team first needs to authorize it.

@AYUSHDAS0601 AYUSHDAS0601 added NSoC26 Nexus Spring of Code Level 3 labels Jun 12, 2026
@AYUSHDAS0601 AYUSHDAS0601 merged commit 885edb4 into AYUSHDAS0601:main Jun 12, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Level 3 NSoC26 Nexus Spring of Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement MVP authentication endpoint for user sign-in flow

2 participants