1.1.0 • Published 8 years ago

ember-cli-simple-auth-firebase v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

#Firebase Authenticator for Ember Simple Auth This is a custom authenticator for the fantastic Ember Simple Auth project.

Installation

If you're using Ember CLI, installation is simple. Just issue the following two commands within your Ember project directory.

ember install emberfire
ember install ember-cli-simple-auth
ember install ember-cli-simple-auth-firebase

Alternatively, you can clone the project and copy the contents of the initializers and authenticators folder into your project.

Note: this addon is dependent on both Emberfire and Ember Simple Auth, so make sure it's part of your project if you're copying in the addon manually.

Usage

After configuring Ember Simple Auth, you'll need to make sure your Firebase is configured in config/environment.js like so:

firebase: 'https://<firebase-name>.firebaseio.com/'

To use it, you can do something like this in one of your controllers:

import Ember from 'ember';

export default Ember.Controller.extend({

    actions: {
        login: function() {
            this.get('session').authenticate('authenticator:firebase', {
                'email': this.get('email'),
                'password': this.get('password')
            }).then(function() {
                this.transitionToRoute('index');
            }.bind(this));
        },
        logout: function() {
            this.get('session').invalidate().then(function() {
                this.transitionToRoute('login');
            }.bind(this));
        }
    }
});

Credits

Thanks to Simplabs for create Ember Simple Auth in the first place!

License

Released under the MIT License.

1.1.0

8 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago