πͺ User Registration & Login
Seamless and secure access to your learning journey
π Authentication Methods
Email/Password Signup & Login: Users register with an email and password, which are securely stored after hashing.
Google OAuth Login: Users can sign in using their Google accounts via OAuth 2.0 integration, streamlining access without creating new credentials.
π Backend Flow
Signup triggers
POST /auth/signupLogin triggers
POST /auth/loginreset password OTP
POST /auth/forgetpasswordUpon successful login, a JWT token is issued and stored on the client for authenticating further requests.
π Security Measures
Passwords are hashed using bcrypt before storage.
Email verification is mandatory before full access.
JWT tokens have expiration to enhance security.
Rate limiting protects against brute force attacks.
π΄ Error Handling
Error
Cause
Response
Notes
InvalidCredentials
Wrong email or password
HTTP 401 Unauthorized
User is prompted to retry
DuplicateEmail
Email already registered
HTTP 409 Conflict
User encouraged to login or reset password
MissingFields
Required fields not provided
HTTP 400 Bad Request
Client-side validation also recommended
TokenExpired
JWT token expired during session
HTTP 401 Unauthorized
User needs to re-authenticate
EmailNotVerified
User tries login without verifying email
HTTP 403 Forbidden
Prompt user to verify email first
π‘ Example API Requests & Responses
User Login
Request:
Success Response:
Error Response (Invalid Credentials):
Last updated