Closed melodyogonna closed 2 months ago
you need to set the origin in nuxt.config like this:
auth: { computed: { origin: process.env.YOUR_OWN_VARIABLE, } }
Unfortunately the documentation is missing a lot of information.
It got fixed by setting NEXTAUTH_URL rather than AUTH_ORIGIN
@melodyogonna What about for prod?
@melodyogonna What about for prod?
I deployed on Vercel, and according to this - https://next-auth.js.org/warnings#nextauth_url%20-%20nuxt VERCEL_URL is automatically set so there is no reason to set NEXTAUTH_URL if you deploy on Vercel. For other environments, I imagine it is necessary but I wouldn't know.
Hi everyone!
I will take some time to refresh our documentation! The vercel guide was originally written for V0.4, so things may have changed.
For now please manually set the NEXAUTH_URL and the origin inside your nuxt.config.ts
. I however, do want to take some time code wise to clean this up and ensure that only one of the two methods is needed.
We have just released our new documentation which improves on the explanation of how ORIGIN is used. Please have a look here: https://auth.sidebase.io/guide/advanced/deployment/self-hosted#authjs-provider
Environment
Darwin
v20.3.1
3.6.1
2.5.2
npm@9.6.7
vite
css
,app
,devtools
,typescript
,build
,runtimeConfig
,modules
,auth
,hooks
@sidebase/nuxt-auth@0.5.0
-
Reproduction
No response
Describe the bug
I'm trying to change the default origin from http://localhost:3000 to a custom origin because I modified the port. I have tried setting NUXT_ORIGIN in an .env file as well as manually setting
origin
on ModuleOptions in nuxt.config.ts, none seem to work, after sign in (with the below code) I'm redirected to http://localhost:3000/user/dashboard rather than http://localhost:1200/user/dashboard (1200) is my custom port.Additional context
No response
Logs
No response