Correction détection de la session
This commit is contained in:
parent
f4528dd087
commit
27720219ee
|
@ -9,13 +9,12 @@ export const useLoggedIn = () => {
|
|||
};
|
||||
|
||||
export function saveLoggedIn(loggedIn: boolean) {
|
||||
console.log("saveLoggedIn", JSON.stringify(loggedIn))
|
||||
window.sessionStorage.setItem(LOGGED_IN_KEY, JSON.stringify(loggedIn));
|
||||
window.localStorage.setItem(LOGGED_IN_KEY, JSON.stringify(loggedIn));
|
||||
}
|
||||
|
||||
export function getSavedLoggedIn(): boolean {
|
||||
try {
|
||||
const loggedIn = JSON.parse(window.sessionStorage.getItem(LOGGED_IN_KEY));
|
||||
const loggedIn = JSON.parse(window.localStorage.getItem(LOGGED_IN_KEY));
|
||||
return !!loggedIn;
|
||||
} catch(err) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue