authmaker-ember-simple-auth
Ember Simple Auth authenticator and authorizer for Authmaker
Last updated 25 days ago by real_ate .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install authmaker-ember-simple-auth 
SYNC missed versions from official npm registry.

authmaker-ember-simple-auth

This addon allows you to get started very quickly with Authmaker and ember-simple-auth. This Readme has some basic information about how to use the addon but if you want a more in-depth description on how to use it you can check the Authmaker Guides

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

Installation

Install this addon.

ember install authmaker-ember-simple-auth

this will setup a few defaults in your application and add a basic configuration to your environment config that you will need to update with the real config from the Authmaker Dashboard. Read the official documentation for more information.

Usage

When you install this addon it will automatically generate a login route for you, along with a few other useful files. If you are starting an Ember app from scratch this should all be ok, but if you are adding Authmaker to an existing Ember app you might need to have a look at the diffs and see how to integrate your code into the provided files.

This addon ultimately uses ember-simple-auth to provide the login functionality and you can follow their documentation to find out more.

Here is an example of a controller that is providing a login action that makes use of Ember Simple Auth's session.authenticate() functionality:

import Controller from '@ember/controller';
import { inject as service } from '@ember/service'

export default Controller.extend({
  session: service(),
  actions: {
    login() {
      this.get('session').authenticate('authenticator:authmaker');
    },
    logout() {
      this.get('session').invalidate();
    }
  }
});

with this in place you can make use of these actions in the template as follows:

{{#if session.isAuthenticated}}
  <button {{action 'logout'}}>logout</button>
{{else}}
  <button {{action 'login'}}>login</button>
{{/if}}

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Current Tags

  • 3.1.0                                ...           latest (25 days ago)

15 Versions

  • 3.1.0                                ...           25 days ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.2.1                                ...           2 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.4                                ...           3 years ago
  • 2.1.3                                ...           3 years ago
  • 2.1.2                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.2.1                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 23
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |