fix: disable sso login when no issuer present

This commit is contained in:
Maximilian Liebmann 2025-05-06 13:07:50 +02:00
parent 43504d31f7
commit bf50f3a5a5
2 changed files with 9 additions and 2 deletions

View file

@ -37,7 +37,12 @@ export default async function LoginPage() {
<hr style={{ width: 230 }} />
{process.env.AUTH_AUTHENTIK_ISSUER && (
<SSOLogin provider='authentik' providerDisplayName='SSO' />
)}
{process.env.AUTH_AUTHENTIK_ISSUER && (
<SSOLogin provider='authentik' providerDisplayName='SSO' />
)}
</div>
);
}

View file

@ -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;