-
![]()
-
- account_circle
-
-
{{ user?.displayName }}
-
{{ user?.email }}
-
+
+
![]()
+
+ account_circle
+
+
{{ user?.displayName }}
+
{{ user?.email }}
+
-
+
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(() => {