-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(auth): check protocol before calling getRedirectResult (#271)
When using AngularFire in non-browser environments, such as Ionic, subscribing to the AngularFireAuth service would cause an error to be thrown. This was because getRedirectResult() is always called at the beginning of the auth observable, to determine if the page is being loaded after a redirect-based oAuth flow. However, calling this method is not supported if location.protocol is not http or https. In the case of Ionic, the protocol is file:. This change adds a check before calling getRedirectResult to make sure the protocol is http or https. BREAKING CHANGE: The AngularFireAuth class has changed the order of its constructor arguments. Since this is usually instantiated automatically via dependency injection, it shouldn't affect common usage of the library. However, if manually instantiating AngularFireAuth in tests or in an application, the order of arguments is now: `(AuthBackend, WindowLocation[, AuthConfiguration])`. Fixes #243
- Loading branch information
1 parent
5ab37bf
commit f38e9d7
Showing
4 changed files
with
77 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters