auth.AuthController
Defined in: backend/src/modules/auth/controllers/AuthController.ts:36
Constructors
Constructor
new AuthController(
authService
):AuthController
Defined in: backend/src/modules/auth/controllers/AuthController.ts:43
Creates a new instance of the AuthController. Uses dependency injection to receive an implementation of IAuthService.
Parameters
authService
The authentication service implementation to use
Returns
AuthController
Methods
changePassword()
changePassword(
body
,request
):Promise
<{message
:string
;success
:boolean
; }>
Defined in: backend/src/modules/auth/controllers/AuthController.ts:125
Parameters
body
request
AuthenticatedRequest
Returns
Promise
<{ message
: string
; success
: boolean
; }>
signup()
signup(
body
):Promise
<Record
<string
,any
>>
Defined in: backend/src/modules/auth/controllers/AuthController.ts:73
Handles user signup/registration requests. Creates new user accounts using the provided credentials.
Parameters
body
Validated signup data containing email, password, and name information
Returns
Promise
<Record
<string
, any
>>
A plain JavaScript object representation of the newly created user
Throws
HttpError - If user creation fails for any reason
verifySignUpProvider()
verifySignUpProvider(
body
):Promise
<Record
<string
,any
>>
Defined in: backend/src/modules/auth/controllers/AuthController.ts:95
Parameters
body
Returns
Promise
<Record
<string
, any
>>
verifyToken()
verifyToken():
Promise
<{message
:string
; }>
Defined in: backend/src/modules/auth/controllers/AuthController.ts:167
Verifies if the user's authentication token is valid. This endpoint is restricted to admin users only. Simply returning a success message confirms the token is valid, as the
Returns
Promise
<{ message
: string
; }>
A confirmation object with message indicating the token is valid
Authorized
decorator would have rejected the request otherwise.
Throws
Automatically rejects unauthorized requests via the
Authorized
decorator