fix: disable sso login when no issuer present
Some checks failed
container-scan / Container Scan (pull_request) Failing after 1m1s
docker-build / docker (pull_request) Failing after 3m59s

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

View file

@ -37,7 +37,12 @@ export default async function LoginPage() {
<hr style={{ width: 230 }} />
<SSOLogin provider='authentik' providerDisplayName='SSO' />
{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;