From 34dd79f6028ef2c19a401547416f22c2dd5a13b4 Mon Sep 17 00:00:00 2001 From: Tim Ittermann Date: Wed, 7 Aug 2024 13:48:42 +0200 Subject: [PATCH] feat: add support for redirect proxy --- src/auth.config.ts | 3 ++- src/env/schema.mjs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/auth.config.ts b/src/auth.config.ts index 18de614..46132c5 100644 --- a/src/auth.config.ts +++ b/src/auth.config.ts @@ -1,5 +1,5 @@ import type { NextAuthConfig } from "next-auth"; -import { Provider } from "next-auth/providers"; +import type { Provider } from "next-auth/providers"; import Facebook from "next-auth/providers/facebook"; import Google from "next-auth/providers/google"; import { env } from "./env/server.mjs"; @@ -28,6 +28,7 @@ if (env.AUTH_FACEBOOK_ID && env.AUTH_FACEBOOK_SECRET) { export const authConfig: NextAuthConfig = { secret: env.NEXTAUTH_SECRET, + redirectProxyUrl: env.REDIRECT_PROXY_URL, session: { maxAge: env.SESSION_VALIDITY_IN_SECONDS, strategy: "jwt", diff --git a/src/env/schema.mjs b/src/env/schema.mjs index ed6ce3d..8956230 100644 --- a/src/env/schema.mjs +++ b/src/env/schema.mjs @@ -23,6 +23,10 @@ export const serverSchema = z.object({ .optional() .describe("The root URL of the server. Used to generate invitation links"), ALLOW_ACCOUNT_LINKING: z.enum(["true", "false"]).default("false"), + REDIRECT_PROXY_URL: z + .string() + .optional() + .describe("The URL to the redirect proxy"), // auth-js Providers AUTH_GOOGLE_ID: z.string().optional(),