From 2e049955c1db2be1d62dbd24e3a557faf2d96271 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 25 Dec 2024 14:02:03 +0100 Subject: [PATCH] nits script lang --- frontend/src/lib/components/Login.svelte | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/frontend/src/lib/components/Login.svelte b/frontend/src/lib/components/Login.svelte index f09d68d376..8b073e4d8a 100644 --- a/frontend/src/lib/components/Login.svelte +++ b/frontend/src/lib/components/Login.svelte @@ -148,14 +148,21 @@ } async function loadLogins() { - const allLogins = await OauthService.listOauthLogins() - logins = allLogins.oauth.map((login) => ({ - type: login.type, - displayName: login.display_name || login.type - })) - saml = allLogins.saml + try { + const allLogins = await OauthService.listOauthLogins() + logins = allLogins.oauth.map((login) => ({ + type: login.type, + displayName: login.display_name || login.type + })) + saml = allLogins.saml - showPassword = (logins.length == 0 && !saml) || (email != undefined && email.length > 0) + showPassword = (logins.length == 0 && !saml) || (email != undefined && email.length > 0) + } catch (e) { + logins = [] + saml = undefined + showPassword = true + console.error('Could not load logins', e) + } } loadLogins()