Skip to content

Commit 169ce64

Browse files
ryanclarkdavideast
authored andcommitted
fix(auth_backend): update logout method to return a promise
Closes #583
1 parent e78cf4b commit 169ce64

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/auth/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export class AngularFireAuth extends ReplaySubject<FirebaseAuthState> {
119119
}
120120
}
121121

122-
public logout(): void {
123-
this._authBackend.unauth();
122+
public logout(): Promise<void> {
123+
return this._authBackend.unauth();
124124
}
125125

126126
public getAuth(): FirebaseAuthState {

src/auth/auth_backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export abstract class AuthBackend {
1111
: Promise<FirebaseAuthState>;
1212
abstract onAuth(): Observable<FirebaseAuthState>;
1313
abstract getAuth(): FirebaseAuthState;
14-
abstract unauth(): void;
14+
abstract unauth(): Promise<void>;
1515
abstract createUser(credentials: EmailPasswordCredentials): Promise<FirebaseAuthState>;
1616
abstract getRedirectResult(): Observable<firebase.auth.UserCredential>;
1717
}

src/auth/firebase_sdk_auth_backend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ export class FirebaseSdkAuthBackend extends AuthBackend {
6767
return observeOn.call(authState, new ZoneScheduler(Zone.current));
6868
}
6969

70-
unauth(): void {
71-
Promise.resolve(this._fbAuth.signOut());
70+
unauth(): Promise<void> {
71+
return <Promise<void>>this._fbAuth.signOut();
7272
}
7373

7474
authWithCustomToken(token: string): Promise<FirebaseAuthState> {

0 commit comments

Comments
 (0)