|
|
@ -8,11 +8,9 @@ import { AuthService } from 'app/core/auth/auth.service'; |
|
|
|
import { WindowService } from 'app/window.service'; |
|
|
|
import { Subject } from 'rxjs'; |
|
|
|
import { takeUntil } from 'rxjs/operators'; |
|
|
|
import { getAuth, RecaptchaVerifier, signInWithPhoneNumber } from "firebase/auth"; |
|
|
|
import firebase from 'firebase/compat/app'; |
|
|
|
import 'firebase/compat/auth'; |
|
|
|
import 'firebase/compat/firestore'; |
|
|
|
import { environment } from 'environments/environment'; |
|
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
|
import { VerificationDialogComponent } from '../verification/verification-dialog.component'; |
|
|
|
import { ProfileImage } from 'app/models/generalModel'; |
|
|
@ -98,12 +96,7 @@ export class AuthSignInComponent implements OnInit { |
|
|
|
* Sign in |
|
|
|
*/ |
|
|
|
authenticate(): void { |
|
|
|
console.log(this.tryagin) |
|
|
|
console.log(this.phonenumber) |
|
|
|
// if(!this.phonenumber && this.phonenumber != this.previousNumber){
|
|
|
|
this.phonenumber = this.signInForm.get('phone').value; |
|
|
|
// }
|
|
|
|
console.log(this.phonenumber) |
|
|
|
this.showAlert = false; |
|
|
|
if (this.phonenumber) |
|
|
|
if (this.tryagin < 3 || this.phonenumber != this.previousNumber) { |
|
|
@ -190,6 +183,11 @@ export class AuthSignInComponent implements OnInit { |
|
|
|
}); |
|
|
|
}).catch((error) => { |
|
|
|
// this.signInForm.reset();
|
|
|
|
this.alert = { |
|
|
|
type: "error", |
|
|
|
message: "An error occurred while authenticating you please try again after a while this could be a result poor internet connection" |
|
|
|
} |
|
|
|
this.showAlert = true; |
|
|
|
grecaptcha.reset(this.recaptchedID); |
|
|
|
this.previousNumber = this.phonenumber; |
|
|
|
}); |
|
|
@ -206,7 +204,7 @@ export class AuthSignInComponent implements OnInit { |
|
|
|
} else { |
|
|
|
this.alert = { |
|
|
|
type: "error", |
|
|
|
message: "An error occurred while authenticating you please try again after a while this could poor internet connection" |
|
|
|
message: "An error occurred while authenticating you please try again after a while this could be a result poor internet connection" |
|
|
|
} |
|
|
|
this.showAlert = true; |
|
|
|
} |
|
|
@ -230,7 +228,6 @@ export class AuthSignInComponent implements OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
clear() { |
|
|
|
console.log(this.newProfilePicture) |
|
|
|
this.newProfilePicture = {}; |
|
|
|
} |
|
|
|
|
|
|
|