diff --git a/build.gradle b/build.gradle index c31de8ad72d..983487e92ae 100644 --- a/build.gradle +++ b/build.gradle @@ -743,4 +743,4 @@ task jacocoReport(type: JacocoReport) { fileTree(dir: it, exclude: ["**/*.jar"]) }) } -} +} \ No newline at end of file diff --git a/random.txt b/random.txt new file mode 100644 index 00000000000..7fec8e25e5a --- /dev/null +++ b/random.txt @@ -0,0 +1 @@ +hello siri \ No newline at end of file diff --git a/src/web/app/pages-help/session-links-recovery/session-links-recovery-page.component.ts b/src/web/app/pages-help/session-links-recovery/session-links-recovery-page.component.ts index 4feb3ec3cce..a5945e6e0d8 100644 --- a/src/web/app/pages-help/session-links-recovery/session-links-recovery-page.component.ts +++ b/src/web/app/pages-help/session-links-recovery/session-links-recovery-page.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { ReCaptcha2Component } from 'ngx-captcha'; import { finalize } from 'rxjs/operators'; import { environment } from '../../../environments/environment'; @@ -41,9 +41,21 @@ export class SessionLinksRecoveryPageComponent implements OnInit { }); } + /** + * Custom validator to disallow whitespace-only values. + */ + noWhitespaceValidator(control: AbstractControl): { [key: string]: boolean } | null { + if (control.value && control.value.trim().length === 0) { + return { 'whitespace': true }; + } + return null; + } + /** * Sends the feedback session links to the recovery email address. */ + + onSubmitFormSessionLinksRecovery(sessionLinksRecoveryForm: UntypedFormGroup): void { if (!this.captchaSiteKey) { this.captchaResponse = '';