Element wrapper for the Firebase authentication API (https://www.firebase.com/docs/web/guide/user-auth.html).
autoLogin
Booleandefault: false
When true, login will be attempted if login status check determines no user is logged in. Should generally only be used with provider types that do not present a login UI, such as 'anonymous'.
location
String
Firebase location URL (must have simple login enabled via Forge interface).
options
Object
Provider-specific options to pass to login, for provider types that take a second object to pass firebase-specific options. May be overridden at
login()
-time.
params
Object
Provider-specific parameters to pass to login. May be overridden at
login()
-time.
provider
Stringdefault: anonymous
Default login provider type. May be one of:
anonymous
, custom
,password
facebook
, github
, twitter
, google
.
redirect
Booleandefault: false
When true, authentication will try to redirect instead of using a popup if possible.
ref
Object readOnly notify
A pointer to the Firebase instance being used by the firebase-auth element.
statusKnown
Booleandefault: false readOnly notify
When true, login status can be determined by checking
user
property.
user
Object readOnly notify
When logged in, this property reflects the firebase user auth object.
changeEmail(oldEmail, newEmail, password)
- oldEmail string
- newEmail string
Changes the email of a "password provider"-based user account.
If the operation is successful, the
email-changed
event is fired.
If the operation fails, the
error
event is fired, with e.detail
containing error information supplied from Firebase.
changePassword(email, oldPassword, newPassword)
- email string
- oldPassword string
- newPassword string
Changes the password of a "password provider"-based user account.
If the operation is successful, the
password-changed
event is fired.
If the operation fails, the
error
event is fired, with e.detail
containing error information supplied from Firebase.
createUser(email, password)
- email string
- password string
Creates a "password provider"-based user account.
If the operation is successful, the
user-created
event is fired.
If the operation fails, the
error
event is fired, with e.detail
containing error information supplied from Firebase.
login(params, options)
- params string (optional)
- options string (optional)
Performs a login attempt, using the
provider
specified via attribute/property, or optionally via provider
argument to the login
function. Optionally, provider-specific login parameters can be specified via attribute (JSON)/property, or via the params
argument to the login
function.
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 network is currently offline, the login attempt will be queued until the network is restored.
logout()
Performs a logout attempt.
If the login is successful, the
logout
event is fired.
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 network is currently offline, the logout attempt will be queued until the network is restored.
removeUser(email, password)
- email string
- password string
Removes a "password provider"-based user account.
If the operation is successful, the
user-removed
event is fired.
If the operation fails, the
error
event is fired, with e.detail
containing error information supplied from Firebase.
sendPasswordResetEmail(email)
- email string
Sends a password reset email for a "password provider"-based user account.
If the operation is successful, the
password-reset
event is fired.
If the operation fails, the
error
event is fired, with e.detail
containing error information supplied from Firebase.
No comments:
Post a Comment