fix: disable sso login when no issuer present
This commit is contained in:
parent
43504d31f7
commit
bf50f3a5a5
2 changed files with 9 additions and 2 deletions
|
@ -37,7 +37,12 @@ export default async function LoginPage() {
|
||||||
|
|
||||||
<hr style={{ width: 230 }} />
|
<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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@ import NextAuth from 'next-auth';
|
||||||
import Authentik from 'next-auth/providers/authentik';
|
import Authentik from 'next-auth/providers/authentik';
|
||||||
|
|
||||||
export const { handlers, signIn, signOut, auth } = NextAuth({
|
export const { handlers, signIn, signOut, auth } = NextAuth({
|
||||||
providers: [Authentik],
|
providers: [process.env.AUTH_AUTHENTIK_ISSUER ? Authentik : null].filter(
|
||||||
|
(x) => x !== null,
|
||||||
|
),
|
||||||
callbacks: {
|
callbacks: {
|
||||||
authorized: async ({ auth }) => {
|
authorized: async ({ auth }) => {
|
||||||
return !!auth;
|
return !!auth;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue