Pages

Tuesday, 1 September 2015

Firebase Auth

Documentation
Element wrapper for the Firebase authentication API (https://www.firebase.com/docs/web/guide/user-auth.html).
Properties
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 atlogin()-time.
        params
        Object
          Provider-specific parameters to pass to login. May be overridden atlogin()-time.
          provider
          Stringdefault: anonymous
            Default login provider type. May be one of: anonymouscustom,password facebookgithubtwittergoogle.
            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.
                    Methods
                    changeEmail(oldEmail, newEmail, password)
                    1. oldEmail string 
                    2. 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)
                    1. email string 
                    2. oldPassword string 
                    3. 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)
                    1. email string 
                    2. 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)
                    1. params string 
                      (optional)
                    2. options string 
                      (optional)
                    Performs a login attempt, using the provider specified via attribute/property, or optionally via provider argument to the loginfunction. Optionally, provider-specific login parameters can be specified via attribute (JSON)/property, or via the params argument to the loginfunction.
                    If the login is successful, the login event is fired, with e.detail.usercontaining 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)
                      1. email string 
                      2. 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)
                      1. 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.