Filter auth methods by multi auth support
This commit is contained in:
parent
31cfd22480
commit
dbf1fbb6b8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue