How to update user data returned from authenticator.isAuthenticated? #17
-
I have something like this: authenticator.use(
new EmailLinkStrategy(
{
sendEmail,
secret,
callbackURL: '/auth',
},
async ({ email }: { email: string }) => {
const user = await getUserByEmail(email);
return user;
},
),
); But if I update user, it's always returning old data when I get it from authenticator.isAuthenticated. |
Beta Was this translation helpful? Give feedback.
Answered by
pbteja1998
Sep 2, 2022
Replies: 1 comment
-
@siimaoo you would need to also update the cookie when you update the user. Otherwise you would be reading the data from a cookie that has old data. So, there needs to be a set cookie header happening in your update user action. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
siimaoo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@siimaoo you would need to also update the cookie when you update the user. Otherwise you would be reading the data from a cookie that has old data.
So, there needs to be a set cookie header happening in your update user action.