chore(auth): add trustedOrigins to allow localhost in dev without impacting production
This commit is contained in:
parent
ab820ddeca
commit
2877f22dfb
1 changed files with 11 additions and 0 deletions
|
|
@ -8,6 +8,17 @@ import { prisma } from "./prisma"
|
||||||
export const auth = betterAuth({
|
export const auth = betterAuth({
|
||||||
secret: env.BETTER_AUTH_SECRET,
|
secret: env.BETTER_AUTH_SECRET,
|
||||||
baseURL: env.BETTER_AUTH_URL,
|
baseURL: env.BETTER_AUTH_URL,
|
||||||
|
// Permite login tanto no domínio de produção quanto no localhost em DEV
|
||||||
|
trustedOrigins: Array.from(
|
||||||
|
new Set(
|
||||||
|
[
|
||||||
|
env.BETTER_AUTH_URL,
|
||||||
|
env.NEXT_PUBLIC_APP_URL,
|
||||||
|
process.env.NODE_ENV !== "production" ? "http://localhost:3000" : undefined,
|
||||||
|
process.env.NODE_ENV !== "production" ? "http://127.0.0.1:3000" : undefined,
|
||||||
|
].filter(Boolean) as string[]
|
||||||
|
)
|
||||||
|
),
|
||||||
database: prismaAdapter(prisma, {
|
database: prismaAdapter(prisma, {
|
||||||
provider: "sqlite",
|
provider: "sqlite",
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue