Filter auth methods by multi auth support

This commit is contained in:
ekzyis 2023-11-22 05:33:16 +01:00
parent 31cfd22480
commit dbf1fbb6b8
1 changed files with 12 additions and 1 deletions

View File

@ -39,9 +39,20 @@ export async function getServerSideProps ({ req, res, query: { callbackUrl, mult
}
}
const providers = await getProviders()
if (multiAuth) {
// multi auth only supported for login with lightning and nostr
const multiAuthSupport = key => ['lightning', 'nostr'].includes(key)
Object.keys(providers).forEach(key => {
if (!multiAuthSupport(key)) {
delete providers[key]
}
})
}
return {
props: {
providers: await getProviders(),
providers,
callbackUrl,
error,
multiAuth