Members
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. |
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. |
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. |
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. |
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. |
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. |
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. |
Resolves when the user has been updated.
Promise.<void>