Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 49452e3

Browse files
authored
Merge pull request #771 from firebase/jw-signOut-promise
Updated signOut() to return a promise
2 parents a736588 + 046e7f8 commit 49452e3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/FirebaseAuth.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@
139139
*/
140140
signOut: function() {
141141
if (this.getAuth() !== null) {
142-
this._auth.signOut();
142+
return this._q.when(this._auth.signOut());
143+
} else {
144+
return this._q.when();
143145
}
144146
},
145147

tests/unit/FirebaseAuth.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ describe('FirebaseAuth',function(){
315315
});
316316

317317
describe('$signOut()',function(){
318+
it('should return a promise', function() {
319+
expect(authService.$signOut()).toBeAPromise();
320+
});
321+
318322
it('will call signOut() on backing auth instance when user is signed in',function(){
319323
spyOn(authService._, 'getAuth').and.callFake(function () {
320324
return {provider: 'facebook'};

0 commit comments

Comments
 (0)