Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions firebase-auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,17 @@
* provider-specific login parameters can be specified via attribute (JSON)/property,
* or via the `params` argument to the `login` function.
*
* If your `provider` is `custom` you must pass a Firebase Auth token as
* `params.token`. You can also optionally pass an auth token as `params.token` for
* providers `facebook`, `google`, `github` and `twitter` to login headlessly.
*
* If the login is successful, the `login` event is fired, with `e.detail.user`
* containing the authenticated user object from Firebase.
*
* If login fails, the `error` event is fired, with `e.detail` containing error
* information supplied from Firebase.
*
* If the browswer supports `navigator.onLine` network status reporting and the
* If the browser supports `navigator.onLine` network status reporting and the
* network is currently offline, the login attempt will be queued until the network
* is restored.
*
Expand Down Expand Up @@ -221,7 +225,9 @@
case 'google':
case 'github':
case 'twitter':
if (this.redirect) {
if (params.token) {
this.ref.authWithOAuthToken(this.provider, params.token, this._loginHandler.bind(this), params);
} else if (this.redirect) {
this.ref.authWithOAuthRedirect(this.provider, this._loginHandler.bind(this), params);
} else {
this.ref.authWithOAuthPopup(this.provider, this._loginHandler.bind(this), params);
Expand Down