Skip to content

Commit

Permalink
fix: remove ProjectId on logout (#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
suhailkakar authored Oct 11, 2024
1 parent 9d69521 commit 40cc7d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/www/hooks/use-api/tokenStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useProjectContext } from "context/ProjectContext";

export const TOKEN_KEY = "PERSISTENT_TOKEN";
export const REFRESH_TOKEN_KEY = "REFRESH_TOKEN";
export const PROJECT_ID_KEY = "projectId";

export const storeToken = (token: string, refreshToken: string) => {
try {
Expand Down Expand Up @@ -35,6 +36,7 @@ export const clearTokens = () => {
try {
localStorage.removeItem(TOKEN_KEY);
localStorage.removeItem(REFRESH_TOKEN_KEY);
localStorage.removeItem(PROJECT_ID_KEY);
} catch (err) {
console.error(`Error clearing persistent token: ${err.message}.`);
}
Expand Down

0 comments on commit 40cc7d3

Please sign in to comment.