Merge branch 'feature/change-password'
This commit is contained in:
@@ -163,6 +163,20 @@ export class AuthService {
|
||||
return this.refreshInFlight$;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the current user's password. Sends the cookie so the server can
|
||||
* keep the current session alive while revoking the user's other sessions.
|
||||
* Emits void on success (204); errors propagate so the caller can show the
|
||||
* server message.
|
||||
*/
|
||||
changePassword(currentPassword: string, newPassword: string): Observable<void> {
|
||||
return this.http.post<void>(
|
||||
`${this.apiConfig.authUrl}/change-password`,
|
||||
{ currentPassword, newPassword },
|
||||
{ withCredentials: true }
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears in-memory auth state immediately, then fires a fire-and-forget
|
||||
* POST to revoke the server-side refresh token cookie.
|
||||
|
||||
Reference in New Issue
Block a user