Skip to content

Issue running demo #27

Description

@drusellers

Environment


  • Operating System: Darwin
  • Node Version: v16.13.0
  • Nuxt Version: 3.3.2
  • Nitro Version: 2.3.2
  • Package Manager: pnpm@7.30.0
  • Builder: vite
  • User Config: css, modules, auth
  • Runtime Modules: @nuxtjs/tailwindcss@6.6.4, @sidebase/nuxt-auth@0.4.4
  • Build Modules: -

Reproduction

git clone git@github.com: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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions