Show the warning about casing on the login screen as well

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-11-16 11:44:13 +01:00
parent 19794bde23
commit 2032586352
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -45,7 +45,12 @@
{{ error }} {{ error }}
</b-message> </b-message>
<form @submit="loginAction"> <form @submit="loginAction">
<b-field :label="$t('Email')" label-for="email"> <b-field
:label="$t('Email')"
label-for="email"
:message="caseWarningText"
:type="caseWarningType"
>
<b-input <b-input
aria-required="true" aria-required="true"
required required
@ -277,6 +282,26 @@ export default class Login extends Vue {
return this.$router.push("/"); return this.$router.push("/");
} }
} }
get hasCaseWarning(): boolean {
return this.credentials.email !== this.credentials.email.toLowerCase();
}
get caseWarningText(): string | undefined {
if (this.hasCaseWarning) {
return this.$t(
"Emails usually don't contain capitals, make sure you haven't made a typo."
) as string;
}
return undefined;
}
get caseWarningType(): string | undefined {
if (this.hasCaseWarning) {
return "is-warning";
}
return undefined;
}
} }
</script> </script>
@ -284,4 +309,7 @@ export default class Login extends Vue {
.container .columns { .container .columns {
margin: 1rem auto 3rem; margin: 1rem auto 3rem;
} }
::v-deep .help.is-warning {
color: #755033;
}
</style> </style>