Created
January 13, 2021 16:41
-
-
Save polluterofminds/598ca362748205ff11a27bf43f1628d4 to your computer and use it in GitHub Desktop.
Check User Sessions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const checkUserSession = async () => { | |
try { | |
const token = localStorage.getItem("pinnie-token"); | |
if(!token) { | |
return false; | |
} else { | |
return await validateToken(token); | |
} | |
} catch (error) { | |
throw error; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment