Skip to content

[Feature]: Implement stub authentication endpoints in GatewayAuthController #32

@matthewhou19

Description

@matthewhou19

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

  • All 5 endpoints fully implemented
  • Request/response DTOs created
  • Database schema updated
  • Service layer methods implemented
  • Proper error handling
  • Integration tests for all endpoints
  • README updated with new endpoint documentation
  • Email templates created (even if console-logged)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions