diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5a94adb..64ed64e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -55,10 +55,10 @@ export class AppComponent { const startTime = localStorage.getItem('sessionTimeJOIN'); if (startTime) { - const startTimeMillis = parseInt(startTime); + const startTimeMills = parseInt(startTime); const currentTime = new Date().getTime(); const timeDifference = 12 * 60 * 60 * 1000; // 12h - if (currentTime - startTimeMillis > timeDifference) { + if (currentTime - startTimeMills > timeDifference) { localStorage.clear(); } } diff --git a/src/app/components/login/forgot-pw/forgot-pw.component.ts b/src/app/components/login/forgot-pw/forgot-pw.component.ts index e35c4bf..b20a6c2 100644 --- a/src/app/components/login/forgot-pw/forgot-pw.component.ts +++ b/src/app/components/login/forgot-pw/forgot-pw.component.ts @@ -5,10 +5,8 @@ import { FormBtnComponent } from '../../../shared/components/buttons/form-btn/fo import { FooterComponent } from '../footer/footer.component'; import { HeaderComponent } from '../header/header.component'; import { TranslateModule } from '@ngx-translate/core'; -import { FirebaseService } from '../../../services/firebase.service'; import { LoginService } from '../../../services/login.service'; import { SharedService } from '../../../services/shared.service'; -import { Router } from '@angular/router'; import { BtnBackComponent } from '../../../shared/components/buttons/btn-back/btn-back.component'; @Component({ @@ -32,27 +30,18 @@ export class ForgotPwComponent { }; constructor( - private firebaseService: FirebaseService, - public loginSerivce: LoginService, - public sharedService: SharedService, - private router: Router + public loginService: LoginService, + public sharedService: SharedService ) {} onSubmit(ngForm: NgForm) { this.sharedService.isBtnDisabled = true; if (ngForm.submitted && ngForm.form.valid) { - this.loginSerivce.passwordReset(this.pwResetData.mail.toLowerCase()); + this.loginService.passwordReset(this.pwResetData.mail.toLowerCase()); } } - existEmailonServer(mail: string) { - return this.firebaseService - .getAllUsers() - .filter((user) => user.email === mail); - } - checkIfUserEmailIsValid(emailValue: string) { - const channelNameLenght = emailValue.length; const emailRegex = /^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/; if (emailRegex.test(emailValue)) { return true; diff --git a/src/app/components/login/register/register.component.html b/src/app/components/login/register/register.component.html index 7409627..2bdd1c4 100644 --- a/src/app/components/login/register/register.component.html +++ b/src/app/components/login/register/register.component.html @@ -77,7 +77,7 @@ !sharedService.isBtnDisabled) {
{{ "register.errorMail1" | translate }}
} @else { @if - (existEmailonServer(registerData.mail.toLowerCase()).length > 0 && + (existEmailOnServer(registerData.mail.toLowerCase()).length > 0 && !sharedService.isBtnDisabled) {{{ "register.errorMail2" | translate }}
} } } @@ -87,7 +87,7 @@ id="password" name="password" #password="ngModel" - [type]="loginSerivce.passwordFieldType" + [type]="loginService.passwordFieldType" placeholder="{{ 'register.password' | translate }}" class="custom-input" autocomplete="new-password" @@ -104,8 +104,8 @@ } @else {