feat(users): add reset password functionality for users and implement forgot password page

This commit is contained in:
Tran Anh Tuan
2026-02-03 17:33:47 +07:00
parent 9bc15192ec
commit dca363275e
35 changed files with 1592 additions and 321 deletions

View File

@@ -7,5 +7,51 @@ declare namespace MasterModel {
interface LoginResponse {
token?: string;
refresh_token: string;
enabled_2fa: boolean;
}
interface RefreshTokenRequestBody {
refresh_token: string;
}
interface RefreshTokenReponse {
access_token: string;
}
interface TokenParsed {
exp: number;
iat: number;
iss: string;
sub: string;
issuer_id: string;
type: number;
purpose: 'access' | 'refresh';
}
interface RefreshTokenParsed extends TokenParsed {
jti: string;
}
interface TokenParsedTransformed {
expriresAt: number;
issuedAt: number;
issuer: string;
/** User Email */
subject: string;
issuerId: string;
type: number;
purpose: 'access' | 'refresh';
}
interface RefreshTokenParsedTransformed extends TokenParsedTransformed {
jwtID: string;
}
interface ForgotPasswordRequestBody {
email: string;
host: string;
}
interface ForgotPasswordResponse {
message: string;
error?: string;
}
}

View File

@@ -41,4 +41,9 @@ declare namespace MasterModel {
limit?: number;
users: UserResponse[];
}
interface UserResetPasswordRequest {
token: string;
password: string;
confirm_password?: string;
}
}