Warning when using capitalized letter in login

This commit is contained in:
Chocobozzz 2021-07-20 13:47:49 +02:00
parent 01af646261
commit 7f28f2ddba
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 14 additions and 2 deletions

View File

@ -28,6 +28,10 @@
<div *ngIf="formErrors.username" class="form-error"> <div *ngIf="formErrors.username" class="form-error">
{{ formErrors.username }} {{ formErrors.username }}
</div> </div>
<div *ngIf="hasUsernameUppercase()" i18n class="form-warning">
⚠️ Most email addresses do not include capital letters.
</div>
</div> </div>
<div class="form-group"> <div class="form-group">

View File

@ -141,6 +141,10 @@ The link will expire within 1 hour.`
this.accordion = instanceAboutAccordion.accordion this.accordion = instanceAboutAccordion.accordion
} }
hasUsernameUppercase () {
return this.form.value['username'].match(/[A-Z]/)
}
private loadExternalAuthToken (username: string, token: string) { private loadExternalAuthToken (username: string, token: string) {
this.isAuthenticatedWithExternalAuth = true this.isAuthenticatedWithExternalAuth = true

View File

@ -123,12 +123,16 @@ code {
vertical-align: middle; vertical-align: middle;
} }
.form-error { .form-error,
.form-warning {
display: block; display: block;
color: $red;
margin-top: 5px; margin-top: 5px;
} }
.form-error {
color: $red;
}
.input-error, .input-error,
my-input-toggle-hidden ::ng-deep input { my-input-toggle-hidden ::ng-deep input {
border-color: $red !important; border-color: $red !important;