Skip to content

Commit

Permalink
feat: let frontend know that user is logged in into decap cms
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat committed Sep 3, 2024
1 parent 25a331c commit edcb0b3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export class TokenAuthBackend implements Implementation {
const status = await this.client.status();
// Authenticate against the delegate backend.
await this.delegate.authenticate(status);
// Let frontend know that user is logged in.
sessionStorage.setItem('decap-cms-logged-in', '1');
// Return status information.
return {
...status,
Expand All @@ -79,6 +81,7 @@ export class TokenAuthBackend implements Implementation {
async logout() {
await this.client.logout();
await this.delegate.logout();
sessionStorage.removeItem('decap-cms-logged-in');
}

/**
Expand Down

0 comments on commit edcb0b3

Please sign in to comment.