Skip to content

Commit

Permalink
chore: now using session storage
Browse files Browse the repository at this point in the history
  • Loading branch information
stamenione committed Jan 22, 2024
1 parent 3062df1 commit 436e7fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class AuthService {

public async logout(): Promise<boolean> {
localStorage.removeItem("api-key");
localStorage.removeItem("breadcrumb-history");
sessionStorage.removeItem("breadcrumb-history");
this.loggedIn.next(false);
this.xsrfService.clearStoredToken();
return await this.router.navigate(["/login"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export class BreadcrumbService {
private readonly router: Router,
private readonly activatedRoute: ActivatedRoute
) {
const storedHistory = localStorage.getItem("breadcrumb-history");
const storedHistory = sessionStorage.getItem("breadcrumb-history");
if (storedHistory) {
this.breadcrumbHistory = JSON.parse(storedHistory);
}
this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
this.updateBreadcrumbHistory();
localStorage.setItem("breadcrumb-history", JSON.stringify(this.breadcrumbHistory));
sessionStorage.setItem("breadcrumb-history", JSON.stringify(this.breadcrumbHistory));
});
}

Expand Down

0 comments on commit 436e7fe

Please sign in to comment.