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

Issue running demo #27

Open
drusellers opened this issue Mar 24, 2023 · 1 comment
Open

Issue running demo #27

drusellers opened this issue Mar 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@drusellers
Copy link

Environment


Reproduction

git clone [email protected]:sidebase/nuxt-auth-example.git
cd nuxt-auth-example
echo 'shamefully-hoist=true' > .npmrc
echo 'auto-install-peers=true' >> .npmrc
pnpm install
pnpm run build
NUXT_SECRET=a-secret AUTH_ORIGIN=https://b-website.com ORIGIN=https://a-website.com PORT=3003 node .output/server/index.mjs

In another terminal

curl -v localhost:3003/protected/globally
#...
< HTTP/1.1 302 Found
< set-cookie: __Host-next-auth.csrf-token=f41225f307a199b55bf3244d9b0a7c2b2f3ac83297ced3117cf9f9e5b4826d80%7C47d8fb2dc0f16eab6150b67f8cc61ad6557d179d0b87174e8827612891457aff; Path=/; HttpOnly; Secure; SameSite=Lax,__Secure-next-auth.callback-url=https%3A%2F%2Fb-website.com; Path=/; HttpOnly; Secure; SameSite=Lax
< location: /api/auth/signin?callbackUrl=%2Fprotected%2Fglobally
# ...
<
* Connection #0 to host localhost left intact
<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=/api/auth/signin?callbackUrl=%2Fprotected%2Fglobally"></head></html>%

You can see that its using the __Secure-next-auth.callback-url=https%3A%2F%2Fb-website.com; b-website

Describe the bug

  1. The demo is out of date with the library and uses ORIGIN in docs but the framework wants AUTH_ORIGIN. So you can see from the reproduction I have to add both.

This has caused a fair bit of confusion as I'm trying to implement nuxt-auth.

Additional context

I'm also curious why sometimes I've seen it redirect to an absolute path, and other times its a relative path. 🤔

Logs

No response

@drusellers drusellers added the bug Something isn't working label Mar 24, 2023
@fyyyyy
Copy link

fyyyyy commented Apr 5, 2023

maybe related
sidebase/nuxt-auth#308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants