diff --git a/pages/login.js b/pages/login.js index d219888b..6c3df2d0 100644 --- a/pages/login.js +++ b/pages/login.js @@ -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