Hi there, thanks for taking the time to read this. Our startup just started implementing an Auth0 login to incorporate logging in with social accounts. We’re using the lock API and we’re also storing some data for each of our users in the user_metadata field.
Unfortunately, it seems like after a user has left the site for more than two hours, we can’t access their user_metadata. We did try to incorporate the checkSession code that’s suggested, however it doesn’t seem to be working and is throwing the following error:
attributes: {error: "Expired token received for JSON Web Token validation"}
error: "Unauthorized"
message: "Expired token received for JSON Web Token validation"
statusCode: 401
The code we’re using is:
this.authenticationLock.checkSession({}, function(error, authResult) {
if (error || !authResult) {
this.authenticationLock.show();
}
else {
request(options, function (error, response, body) {
if (error) throw new Error(error);
try {
if (body !== null && JSON.parse(body).user_metadata !== undefined) {
// do stuff with response here
}
}
catch (e) {
}
});
}
});
Are we doing something wrong?
Thanks for the help!