feat(auth): add recover and reset password functionality

This commit is contained in:
csimonis 2025-05-15 12:31:08 +02:00 committed by Phan Huy Tran
commit 2305e83647
6 changed files with 322 additions and 0 deletions

View file

@ -77,6 +77,14 @@ export class AuthService {
public verifyEmail(token: string): Observable<unknown> {
return this.http.post<unknown>(`${this.authUrl}/verify?token=${token}`, null);
}
public recoverPassword(email: string): Observable<unknown> {
return this.http.post<unknown>(`${this.authUrl}/recover-password?email=${email}`, null);
}
public resetPassword(token: string, password: string): Observable<unknown> {
return this.http.post<unknown>(`${this.authUrl}/reset-password`, { token, password });
}
private setToken(token: string): void {
localStorage.setItem(TOKEN_KEY, token);