Auth0 Home Blog Docs

Token in the client to react

react

#1

hello, I currently use this code with localstorage

const isAuthenticated = ()=>{
const token = localStorage.getItem(‘token’)
let isValid = true
try{
isValid = decode(token);
}catch(e){
return false;
}
return isValid;
};

I would like to know how it would be the same but with cookies, thanks:)