Skip to content

Commit

Permalink
fix(mon-domifa): fail after login
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Dec 5, 2023
1 parent 9fefd96 commit 1fc87ca
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ export class UsagerAuthService {
}

public getToken(): string | null {
return localStorage.getItem(TOKEN_KEY);
const token: string | null = localStorage.getItem(TOKEN_KEY);
if (!token) {
return null;
}
return JSON.parse(token);
}

public saveToken(apiAuthResponse: PortailUsagerAuthApiResponse): void {
// Enregistrement du token
localStorage.removeItem(TOKEN_KEY);
localStorage.setItem(TOKEN_KEY, JSON.stringify(apiAuthResponse.token));

// Build usager
this.saveAuthUsager(apiAuthResponse.profile);
}

Expand Down

0 comments on commit 1fc87ca

Please sign in to comment.