Skip to main content

auth.IAuthService

Defined in: backend/src/modules/auth/interfaces/IAuthService.ts:26

Interface representing the authentication service. Defines the contract that any authentication service implementation must fulfill, regardless of the underlying authentication provider.

Methods

changePassword()

changePassword(body, requestUser): Promise<{ message: string; success: boolean; }>

Defined in: backend/src/modules/auth/interfaces/IAuthService.ts:61

Changes the password for an authenticated user. Validates that the new password meets requirements and updates the user's credentials in the authentication system.

Parameters

body

ChangePasswordBody

The payload containing the new password and confirmation

requestUser

IUser

The authenticated user requesting the password change

Returns

Promise<{ message: string; success: boolean; }>

A promise that resolves to a confirmation object with success status and message

Throws

Error - If password change fails or validation errors occur


signup()

signup(body): Promise<IUser>

Defined in: backend/src/modules/auth/interfaces/IAuthService.ts:37

Signs up a new user in the system. Creates a new user account with the provided credentials and stores the user information in the database.

Parameters

body

SignUpBody

The validated payload containing user registration information including email, password, first name, and last name

Returns

Promise<IUser>

A promise that resolves to the newly created user object

Throws

Error - If user creation fails for any reason


verifySignUpProvider()

verifySignUpProvider(token): Promise<IUser>

Defined in: backend/src/modules/auth/interfaces/IAuthService.ts:39

Parameters

token

string

Returns

Promise<IUser>


verifyToken()

verifyToken(token): Promise<IUser>

Defined in: backend/src/modules/auth/interfaces/IAuthService.ts:49

Verifies the validity of an authentication token. Decodes the token and retrieves the associated user information.

Parameters

token

string

The authentication token to verify (typically a JWT)

Returns

Promise<IUser>

A promise that resolves to the user associated with the token

Throws

Error - If the token is invalid, expired, or cannot be verified