From f88f2cc922353e91866b1454a1eb8efe1ef4a6a8 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Thu, 15 Feb 2024 16:20:28 +0100 Subject: [PATCH] Skip screens consistency --- account-gui/src/components/SubContent.svelte | 2 +- account-gui/src/locale/en.js | 1 + account-gui/src/locale/nl.js | 1 + account-gui/src/routes/UseLink.svelte | 15 +++++++++++++++ account-gui/src/routes/UseWebAuth.svelte | 14 +++++++------- .../java/myconext/MyConextServerApplication.java | 3 +-- .../main/java/myconext/model/UserResponse.java | 2 ++ .../src/main/resources/application.yml | 4 +++- 8 files changed, 31 insertions(+), 11 deletions(-) diff --git a/account-gui/src/components/SubContent.svelte b/account-gui/src/components/SubContent.svelte index 248d16c3..7592ad63 100644 --- a/account-gui/src/components/SubContent.svelte +++ b/account-gui/src/components/SubContent.svelte @@ -10,8 +10,8 @@ export let route = null; export let href = null; export let isMfa = false; - let isMfaParameter = false; + let isMfaParameter = false; let showModal = false; onMount(() => { diff --git a/account-gui/src/locale/en.js b/account-gui/src/locale/en.js index 50827097..f850cbfc 100644 --- a/account-gui/src/locale/en.js +++ b/account-gui/src/locale/en.js @@ -67,6 +67,7 @@ I18n.translations.en = { forgotPassword: "Forgot your password?", useAnother: "Use another", optionsLink: "sign-in option.", + sendingEmail: "Sending email..." }, options: { header: "How do you want to login?", diff --git a/account-gui/src/locale/nl.js b/account-gui/src/locale/nl.js index ffd803d6..6a1573f7 100644 --- a/account-gui/src/locale/nl.js +++ b/account-gui/src/locale/nl.js @@ -67,6 +67,7 @@ I18n.translations.nl = { forgotPassword: "Wachtwoord vergeten?", useAnother: "Gebruik een andere", optionsLink: "inlogmethode.", + sendingEmail: "Email aan het sturen..." }, options: { header: "Hoe wil je inloggen?", diff --git a/account-gui/src/routes/UseLink.svelte b/account-gui/src/routes/UseLink.svelte index eb3240f0..2dd387b6 100644 --- a/account-gui/src/routes/UseLink.svelte +++ b/account-gui/src/routes/UseLink.svelte @@ -55,8 +55,23 @@ }; + {#if showSpinner} +
+ {#if mrccValue} +

{I18n.t("login.sendingEmail")}

+ {/if} +
{/if} {#if !showSpinner && !mrccValue}

{I18n.t("useLink.header")}

diff --git a/account-gui/src/routes/UseWebAuth.svelte b/account-gui/src/routes/UseWebAuth.svelte index 196d68e4..ed20b234 100644 --- a/account-gui/src/routes/UseWebAuth.svelte +++ b/account-gui/src/routes/UseWebAuth.svelte @@ -16,17 +16,15 @@ export let id; let showSpinner = true; let serviceName = ""; - let mrccValue = null; + let isMrcc = null; onMount(() => { const urlParams = new URLSearchParams(window.location.search); - mrccValue = urlParams.get(mrcc); - if (mrccValue) { - showSpinner = false; + isMrcc = urlParams.has(mrcc); + if (isMrcc) { webAuthnStart(); } else { $links.displayBackArrow = true; - fetchServiceName(id).then(res => { serviceName = res.name; showSpinner = false; @@ -37,6 +35,8 @@ const webAuthnStart = (test = false) => { webAuthnStartAuthentication($user.email, id, test) .then(request => { + showSpinner = false; + isMrcc = false; get({publicKey: request.publicKeyCredentialRequestOptions}) .then(credentials => { //rawId is not supported server-side @@ -70,7 +70,7 @@ {#if showSpinner} {/if} - +{#if !isMrcc}

{I18n.t("webAuthn.header")}

{#if serviceName}

{I18n.t("login.headerSubTitle")}{serviceName}

@@ -82,4 +82,4 @@ className="full" onClick={webAuthnStart}/> - +{/if} diff --git a/myconext-server/src/main/java/myconext/MyConextServerApplication.java b/myconext-server/src/main/java/myconext/MyConextServerApplication.java index 2b39932b..5eaa2bff 100644 --- a/myconext-server/src/main/java/myconext/MyConextServerApplication.java +++ b/myconext-server/src/main/java/myconext/MyConextServerApplication.java @@ -1,12 +1,11 @@ package myconext; import org.springframework.boot.SpringApplication; -import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.scheduling.annotation.EnableScheduling; -@SpringBootApplication(exclude = {SecurityAutoConfiguration.class, MetricsAutoConfiguration.class}) +@SpringBootApplication(exclude = {SecurityAutoConfiguration.class}) @EnableScheduling public class MyConextServerApplication { diff --git a/myconext-server/src/main/java/myconext/model/UserResponse.java b/myconext-server/src/main/java/myconext/model/UserResponse.java index 76a894fa..e3ede24e 100644 --- a/myconext-server/src/main/java/myconext/model/UserResponse.java +++ b/myconext-server/src/main/java/myconext/model/UserResponse.java @@ -23,6 +23,7 @@ public class UserResponse implements Serializable { private final String chosenName; private final String givenName; private final String familyName; + private final String displayName; private final boolean usePassword; private final boolean usePublicKey; private final boolean forgottenPassword; @@ -46,6 +47,7 @@ public UserResponse(User user, this.chosenName = user.getChosenName(); this.givenName = user.getGivenName(); this.familyName = user.getFamilyName(); + this.displayName = this.givenName + " " + this.familyName; this.schacHomeOrganization = user.getSchacHomeOrganization(); this.uid = user.getUid(); this.usePassword = StringUtils.hasText(user.getPassword()); diff --git a/myconext-server/src/main/resources/application.yml b/myconext-server/src/main/resources/application.yml index 18eef74b..4a949903 100644 --- a/myconext-server/src/main/resources/application.yml +++ b/myconext-server/src/main/resources/application.yml @@ -185,13 +185,15 @@ management: endpoints: web: exposure: - include: "health,info,mappings" + include: "health,info,mappings,metrics" base-path: "/internal" endpoint: info: enabled: true mappings: enabled: true + metrics: + enabled: true info: git: mode: full