diff --git a/.circleci/config.yml b/.circleci/config.yml index 018dfb4e..9d46b603 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: build: docker: # specify the version you desire here - - image: circleci/node:8.9.4 + - image: circleci/node:10 # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images diff --git a/.nvmrc b/.nvmrc index b4de3947..48082f72 100755 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -11 +12 diff --git a/projects/ngx-auth-firebaseui/src/lib/components/ngx-auth-firebaseui/auth.component.html b/projects/ngx-auth-firebaseui/src/lib/components/ngx-auth-firebaseui/auth.component.html index 84518ea0..dc0d2922 100755 --- a/projects/ngx-auth-firebaseui/src/lib/components/ngx-auth-firebaseui/auth.component.html +++ b/projects/ngx-auth-firebaseui/src/lib/components/ngx-auth-firebaseui/auth.component.html @@ -5,7 +5,7 @@ - we arrived from the guard after trying to access a protected route even though we are connected -->
- -
- - - - -
{{ user?.displayName }}
-
{{ user?.email }}
-
- - {{ verifyEmailGoBackText }} - -
+
+ + + + +
{{ user?.displayName }}
+
{{ user?.email }}
+
+ + {{ verifyEmailGoBackText }} +
- +
diff --git a/projects/ngx-auth-firebaseui/src/lib/components/ngx-auth-firebaseui/auth.component.ts b/projects/ngx-auth-firebaseui/src/lib/components/ngx-auth-firebaseui/auth.component.ts index 125ae6ca..fb1a3e8c 100755 --- a/projects/ngx-auth-firebaseui/src/lib/components/ngx-auth-firebaseui/auth.component.ts +++ b/projects/ngx-auth-firebaseui/src/lib/components/ngx-auth-firebaseui/auth.component.ts @@ -71,6 +71,7 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro @Input() tabIndex: number | null; @Input() registrationEnabled = true; @Input() resetPasswordEnabled = true; + @Input() connectedUserScreenEnabled = true; @Input() guestEnabled = true; @Input() tosUrl: string; @Input() privacyPolicyUrl: string; @@ -85,6 +86,7 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro // tslint:disable-next-line:no-output-on-prefix @Output() onError: any; @Output() selectedTabChange: EventEmitter = new EventEmitter(); + @Output() loading: EventEmitter = new EventEmitter(); // Password strength api @Input() enableLengthRule = true; @@ -192,6 +194,15 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro return this.authenticationError ? 'warn' : 'primary'; } + public isEmailConfirmationScreenVisible(user: firebase.User): boolean { + return (this.config.guardProtectedRoutesUntilEmailIsVerified && !user.emailVerified) + || (this.authProcess.emailConfirmationSent && !user.emailVerified); + } + + public isUserProfileScreenVisible(user: firebase.User): boolean { + return !this.isEmailConfirmationScreenVisible(user) && this.connectedUserScreenEnabled; + } + public ngOnInit(): void { if (isPlatformBrowser(this.platformId)) { this.onErrorSubscription = this.onError.subscribe(() => this.authenticationError = true); @@ -245,10 +256,12 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro async signOut() { try { this.isLoading = true; + this.loading.emit(true); this.changeDetectorRef.markForCheck(); await this.authProcess.signOut(); } finally { this.isLoading = false; + this.loading.emit(false); this.changeDetectorRef.markForCheck(); } } @@ -259,6 +272,7 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro } try { this.isLoading = true; + this.loading.emit(true); this.changeDetectorRef.markForCheck(); await this.authProcess.signInWith(this.authProviders.EmailAndPassword, { email: this.signInFormGroup.value.email, @@ -266,6 +280,7 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro }); } finally { this.isLoading = false; + this.loading.emit(false); this.changeDetectorRef.markForCheck(); } } @@ -304,6 +319,7 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro async signUp() { try { this.isLoading = true; + this.loading.emit(true); this.changeDetectorRef.markForCheck(); return await this.authProcess.signUp( this.signUpFormGroup.value.name, @@ -314,6 +330,7 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro ); } finally { this.isLoading = false; + this.loading.emit(false); this.changeDetectorRef.markForCheck(); } } @@ -321,15 +338,16 @@ export class AuthComponent implements OnInit, AfterViewInit, OnChanges, OnDestro async signUpAnonymously() { try { this.isLoading = true; + this.loading.emit(true); this.changeDetectorRef.markForCheck(); await this.authProcess.signInWith(this.authProvider.ANONYMOUS); } finally { this.isLoading = false; + this.loading.emit(false); this.changeDetectorRef.markForCheck(); } } - resetPassword() { this.authProcess.resetPassword(this.resetPasswordEmailFormControl.value) .then(() => {