Skip to content

Instantly share code, notes, and snippets.

@polluterofminds
Created January 13, 2021 16:41
Show Gist options
  • Save polluterofminds/598ca362748205ff11a27bf43f1628d4 to your computer and use it in GitHub Desktop.
Save polluterofminds/598ca362748205ff11a27bf43f1628d4 to your computer and use it in GitHub Desktop.
Check User Sessions
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