Problem
GatewayAuthController has 5 stub endpoints that currently return placeholder strings. These need to be properly implemented to provide complete user management functionality.
Proposed solution
1. POST /auth/change-username
Current: Returns "changeUsername"
Needed:
- Validate new username (unique, format)
- Update user record
- Require current password or JWT authentication
- Return updated user details
2. POST /auth/change-email
Current: Returns "changeEmail"
Needed:
- Validate new email (unique, format)
- Send verification email to new address
- Require email verification before updating
- Return confirmation message
3. POST /auth/change-password
Current: Returns "changePassword"
Needed:
- Require current password
- Validate new password strength
- Hash and update password
- Invalidate all refresh tokens (force re-login)
4. POST /auth/reset-password
Current: Returns "resetPassword" (partially implemented - already in publicUrls)
Needed:
- Generate password reset token
- Send reset email
- Implement token verification endpoint
- Allow password update with valid token
5. POST /auth/verify-email
Current: Returns "verifyEmail"
Needed:
- Accept email verification token
- Mark email as verified in database
- Send welcome email
- Return success confirmation
Acceptance criteria
Acceptance Criteria
Problem
GatewayAuthController has 5 stub endpoints that currently return placeholder strings. These need to be properly implemented to provide complete user management functionality.
Proposed solution
1.
POST /auth/change-usernameCurrent: Returns
"changeUsername"Needed:
2.
POST /auth/change-emailCurrent: Returns
"changeEmail"Needed:
3.
POST /auth/change-passwordCurrent: Returns
"changePassword"Needed:
4.
POST /auth/reset-passwordCurrent: Returns
"resetPassword"(partially implemented - already in publicUrls)Needed:
5.
POST /auth/verify-emailCurrent: Returns
"verifyEmail"Needed:
Acceptance criteria
Acceptance Criteria