From dbf1fbb6b88b2ecfc46941965379cc72b9fa7ce0 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Wed, 22 Nov 2023 05:33:16 +0100 Subject: [PATCH] Filter auth methods by multi auth support --- pages/login.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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