Class

AuthService

AuthService()

Service encapsulating authentication, session, and profile workflows.

Constructor

# new AuthService()

View Source services/auth.service.js, line 10

Members

# static changePassword

Self-service endpoints - authenticated users only

View Source grpc/auth.js, line 1290

# static createUser

Admin-only endpoints

View Source grpc/auth.js, line 1337

# static getUserById

Retrieve user by id (Admin only)

View Source grpc/auth.js, line 1347

# static login

Public authentication endpoint - anyone with valid credentials

View Source grpc/auth.js, line 1280

# static refreshToken

Token management

View Source grpc/auth.js, line 1318

Methods

# async changeAvatar(userId, avatar) → {Promise.<string>}

Replace a user's avatar with a new image.

Parameters:
Name Type Description
userId string

Target user identifier.

avatar string

Base64 encoded avatar payload.

View Source services/auth.service.js, line 106

URL of the uploaded avatar.

Promise.<string>

# async changePassword(userId, passwordData) → {Promise.<void>}

Change a user's password after validating the current one.

Parameters:
Name Type Description
userId string

Target user identifier.

passwordData ChangePasswordRequest

Contains current and new passwords.

View Source services/auth.service.js, line 51

Resolves when the password is updated.

Promise.<void>

# async getUser(userId) → {Promise.<ICurrentUserResponse>}

Retrieve a sanitized user profile.

Parameters:
Name Type Description
userId string

Target user identifier.

View Source services/auth.service.js, line 84

User response DTO.

Promise.<ICurrentUserResponse>

# async login(credentials) → {Promise.<TokenResponse>}

Authenticate a user and generate tokens.

Parameters:
Name Type Description
credentials ILoginDto

Login credentials payload.

View Source services/auth.service.js, line 16

Access/refresh token pair.

Promise.<TokenResponse>

# async refreshToken(refreshToken) → {Promise.<IRefreshTokenResponseDto>}

Exchange a refresh token for a new access token.

Parameters:
Name Type Description
refreshToken string

Refresh token string.

View Source services/auth.service.js, line 141

Response containing a new access token.

Promise.<IRefreshTokenResponseDto>

# async updateOwnName(userId, name) → {Promise.<void>}

Update the authenticated user's name and refresh cache entries.

Parameters:
Name Type Description
userId string

Target user identifier.

name string

New display name.

View Source services/auth.service.js, line 170

Resolves when persistence is complete.

Promise.<void>

# async updateUserByEmail(email, name, roleopt) → {Promise.<void>}

Update a user's record by email (admin only).

Parameters:
Name Type Attributes Description
email string

User email lookup key.

name string

New display name.

role TUserRole <optional>

Optional role override.

View Source services/auth.service.js, line 197

Resolves when the user has been updated.

Promise.<void>