8000 Problem with Reauthentication (setCookie) · Issue #7 · jeremycoder/nuxt-iam · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Problem with Reauthentication (setCookie) #7
Open
@mobius77

Description

@mobius77

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0