Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Reauthentication (setCookie) #7

Open
mobius77 opened this issue Nov 22, 2023 · 0 comments
Open

Problem with Reauthentication (setCookie) #7

mobius77 opened this issue Nov 22, 2023 · 0 comments

Comments

@mobius77
Copy link

Hello.

In file \server\middleware\iam\authentication\index.ts we call 2 functions:

  • const authenticated = await isAuthenticated(event)
  • await getUserFromAccessToken(event)

In first function we setCookie if we reauthenticate user:
setCookie(event, 'iam-access-token', 'Bearer ' + tokens.accessToken, { httpOnly: true, secure: true })
, but when we read this cookies in second function:
getCookie(event, "iam-access-token") as string;
we got an old value until next request.

I thought that it must be some time between set and get cookies and have added pause-function for 10sec, but problem still there.
Cookie don't want to set until next request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant