From bf50f3a5a5f080d632f66c785359a3a9d696ca3e Mon Sep 17 00:00:00 2001
From: SomeCodecat <88855796+SomeCodecat@users.noreply.github.com>
Date: Tue, 6 May 2025 13:07:50 +0200
Subject: [PATCH] fix: disable sso login when no issuer present
---
src/app/login/page.tsx | 7 ++++++-
src/auth.ts | 4 +++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx
index 68b1584..b20e030 100644
--- a/src/app/login/page.tsx
+++ b/src/app/login/page.tsx
@@ -37,7 +37,12 @@ export default async function LoginPage() {
-
+ {process.env.AUTH_AUTHENTIK_ISSUER && (
+
+ )}
+ {process.env.AUTH_AUTHENTIK_ISSUER && (
+
+ )}
);
}
diff --git a/src/auth.ts b/src/auth.ts
index 1d91260..50b654c 100644
--- a/src/auth.ts
+++ b/src/auth.ts
@@ -2,7 +2,9 @@ import NextAuth from 'next-auth';
import Authentik from 'next-auth/providers/authentik';
export const { handlers, signIn, signOut, auth } = NextAuth({
- providers: [Authentik],
+ providers: [process.env.AUTH_AUTHENTIK_ISSUER ? Authentik : null].filter(
+ (x) => x !== null,
+ ),
callbacks: {
authorized: async ({ auth }) => {
return !!auth;