Skip to content

Commit

Permalink
Fixes #660
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jan 22, 2025
1 parent 9f15747 commit 20c32b0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions account-gui/src/routes/Request.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,20 @@
$user.givenName = e.target.value = givenName;
}
const handleGivenNameBlur = e => {
const givenName = e.target.value.trim();
$user.givenName = e.target.value = givenName;
}
const updateFamilyName = e => {
const familyName = e.target.value.replace(/[<>]/g, "");
$user.familyName = e.target.value = familyName;
}
const handleFamilyNameBlur = e => {
const familyName = e.target.value.trim();
$user.familyName = e.target.value = familyName;
}
</script>

<style lang="scss">
Expand Down Expand Up @@ -248,7 +257,8 @@
id="given-name"
placeholder={I18n.t("login.givenNamePlaceholder")}
spellcheck="false"
on:input={updateGivenName}>
on:input={updateGivenName}
on:blur={handleGivenNameBlur}>
{#if !initial && !$user.givenName}
<span class="error">{I18n.t("login.requiredAttribute", {attr: I18n.t("login.givenName")})}</span>
{/if}
Expand All @@ -257,7 +267,8 @@
id="family-name"
spellcheck="false"
placeholder={I18n.t("login.familyNamePlaceholder")}
on:input={updateFamilyName}>
on:input={updateFamilyName}
on:blur={handleFamilyNameBlur}>
{#if !initial && !$user.familyName}
<span class="error">{I18n.t("login.requiredAttribute", {attr: I18n.t("login.familyName")})}</span>
{/if}
Expand Down

0 comments on commit 20c32b0

Please sign in to comment.