clean code

This commit is contained in:
Chneemann 2024-05-23 08:59:53 +02:00
parent f6fdf09fca
commit a5af2cc11e
2 changed files with 2 additions and 15 deletions

View file

@ -43,11 +43,7 @@
} @else { @if (mail.touched && } @else { @if (mail.touched &&
!checkIfUserEmailIsValid(pwResetData.mail.toLowerCase())) { !checkIfUserEmailIsValid(pwResetData.mail.toLowerCase())) {
<p>{{ "register.errorMail1" | translate }}</p> <p>{{ "register.errorMail1" | translate }}</p>
} @else { } }
@if(existEmailonServer(pwResetData.mail.toLowerCase()).length !== 1 &&
mail.touched) {
<p>{{ "register.errorMail3" | translate }}</p>
} } }
</div> </div>
</div> </div>
<div class="notice"> <div class="notice">

View file

@ -49,7 +49,6 @@ export class LoginService {
} }
}) })
.catch((error) => { .catch((error) => {
console.error(error);
this.errorCode = error.code; this.errorCode = error.code;
this.sharedService.isBtnDisabled = false; this.sharedService.isBtnDisabled = false;
}); });
@ -93,7 +92,7 @@ export class LoginService {
this.createUserInFirestore(userDataToSave); this.createUserInFirestore(userDataToSave);
}) })
.catch((error) => { .catch((error) => {
console.error(error); this.sharedService.isBtnDisabled = false;
}); });
} }
@ -130,14 +129,11 @@ export class LoginService {
}); });
}) })
.catch((error) => { .catch((error) => {
console.error('Google login error:', error);
this.sharedService.isBtnDisabled = false; this.sharedService.isBtnDisabled = false;
}); });
} }
async createUserInFirestore(user: User) { async createUserInFirestore(user: User) {
console.log(user);
const userDataToSave: User = { const userDataToSave: User = {
uId: user.uId, uId: user.uId,
email: user.email, email: user.email,
@ -170,8 +166,6 @@ export class LoginService {
await updateDoc(doc(collection(this.firestore, 'users'), userId), { await updateDoc(doc(collection(this.firestore, 'users'), userId), {
status: status, status: status,
lastLogin: new Date().getTime(), lastLogin: new Date().getTime(),
}).catch((err) => {
console.error(err);
}); });
window.location.reload(); window.location.reload();
} }
@ -214,8 +208,6 @@ export class LoginService {
this.sharedService.isBtnDisabled = false; this.sharedService.isBtnDisabled = false;
}) })
.catch((error) => { .catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
this.sharedService.isBtnDisabled = false; this.sharedService.isBtnDisabled = false;
}); });
} }
@ -228,7 +220,6 @@ export class LoginService {
this.sharedService.isBtnDisabled = false; this.sharedService.isBtnDisabled = false;
}) })
.catch((error) => { .catch((error) => {
console.error('Fehler beim Zurücksetzen des Passworts:', error);
this.sharedService.isBtnDisabled = false; this.sharedService.isBtnDisabled = false;
}); });
} }