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

Error with multiple value cookies and appendHeader #51

Closed
Hebilicious opened this issue Jul 27, 2023 Discussed in #46 · 2 comments
Closed

Error with multiple value cookies and appendHeader #51

Hebilicious opened this issue Jul 27, 2023 Discussed in #46 · 2 comments

Comments

@Hebilicious
Copy link
Owner

Discussed in #46

Originally posted by misway July 23, 2023
Hello,

When testing locally dev, both versions work fine. However, when I deploy them to Cloudflare Pages, v0.1.8 works without any issues, but v0.1.9 ~ v0.2.0-beta.1 fail to maintain the authenticated state and consistently show 'unauthenticated' status.

I tried adding signIn and session callbacks, and used wrangler pages deployment tail to observe the server and console.log message. I found that signIn functions properly on both version, and I can obtain the authentication information. However, after version 0.1.9, the session callback is not being triggered.

v0.1.8
https://github.com/misway/authjs018
https://authjs018.pages.dev/

POST https://authjs018.pages.dev/api/auth/signin/google? - Ok
GET https://authjs018.pages.dev/api/auth/callback/google?code=4%REDACTED&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&authuser=0&prompt=none - Ok

  (log) signIn called
  (log) { ... profile content ... }

GET https://authjs018.pages.dev/ - Ok

  (log) session called
  (log) { ... session content ... }

v0.1.10
https://github.com/misway/authjs0110
https://authjs0110.pages.dev/

POST https://authjs0110.pages.dev/api/auth/signin/google? - Ok
GET https://authjs0110.pages.dev/api/auth/callback/google?code=4%REDACTED&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&prompt=none - Ok

  (log) signIn called
  (log) { ... profile content ... }

GET https://authjs0110.pages.dev/ - Ok
GET https://authjs0110.pages.dev/api/auth/session - Ok
GET https://authjs0110.pages.dev/ - Ok
@Hebilicious Hebilicious added upstream bug Something isn't working labels Jul 27, 2023
@Hebilicious
Copy link
Owner Author

Hebilicious commented Jul 27, 2023

This bug is fixed in the latest version of nitropack unjs/nitro#1452 , that you can use with the edge channels :

For npm, yarn and pnpm.

{
  "dependencies": {
    "nuxt": "latest",
    "nitropack": "npm:nitropack-edge@latest",
  },
  "overrides": {
    "nitropack": "npm:nitropack-edge@latest"
  },
    "resolutions": {
    "nitropack": "npm:nitropack-edge@latest"
  },
    "pnpm": {
    "overrides": {
      "nitropack": "npm:nitropack-edge@latest"
    }
  }
}

@Hebilicious
Copy link
Owner Author

Closing this as I've updated the README for the required dependencies: 28e246a

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

No branches or pull requests

1 participant