-
Notifications
You must be signed in to change notification settings - Fork 4
Login & Signup
Prajwala Shambulingappa edited this page Apr 24, 2025
·
1 revision
This documentation covers the functionality, flow, and key components of the Login and Signup pages for the Audemy.
What it does: Allows users to sign into their existing accounts using email/password or Google OAuth.
Key Features:
- Email/Password Login with validation
- Google OAuth Login
- JWT Token Decoding & Expiry Check for secure session handling
- Error Alerts shown on common HTTP failures (400, 401, 403, etc.)
- Session Stored in Cookies (audemyUserSession)
- School Prompt shown only if Google login returns a user not present in DB
File: Login.vue
- Components used:
- User flow:
- User submits credentials or authenticates with Google
- If valid, JWT token is stored
- Redirects to /game-zone
- If school data is missing (Google login), user is prompted to enter it
Error Handling: All HTTP status codes like 401, 403, 500, etc., are interpreted and shown as user-friendly alerts.
What it does: Registers a new user with basic details, performs form validation, then auto-logs them in.
Key Features:
- Form validation for required fields and matching passwords
- Visual Feedback on password match
- POST request to /api/auth/signup
- Auto-login after successful registration
- Fallback alerts for server and network issues
Files: Signup.vue, Signup.js
- Data collected: First name, last name, school, email, password
- User flow:
- User enters form details and submits
- Passwords are validated in real-time
- After success, automatic login is triggered
- Session stored in cookie, user redirected to /game-zone
Error Handling: Custom error messages based on status codes. Network issues handled in .catch() block with fallback alerts.
- Session handling via cookies (7-day expiration)
- JWT token expiration check with jwt-decode
- Passwords checked and feedback given before form submission
- Separate error display logic using handleApiError()
- Clean and readable component structure for maintainability
- Introduction
- For Everyone
- For Developers
- For Designers
- For Management
- Introduction
- For Everyone
- For Developers
- For Designers
- For Management
- Banner
- Other Reusable Components (to be added)
- Introduction
- For Everyone
- For Developers
- For Designers
- For Management
- Resources for a New Developer
- Resources for a New Designer
- Resources for a New Project Manager