0.5.0 • Published 8 years ago

ember-authenticate-me v0.5.0

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

Ember-authenticate-me

This addon hooks Torii up to work out of the box with the Rails gem token-authenticate-me and includes some default templates, routes, and controllers.

Installation (requires ember-cli 2.11.0 or greater and ember-cli-htmlbars 1.1.1 or greater)

In your app's root Ember directory (typically app-ember), run:

  • ember install ember-authenticate-me

ember g ember-authenticate-me adds to your app/router.js router map:

this.route('login');
this.route('logout');
this.route('sign-up');
this.route('forgot-password');

this.route('reset-password', {
  path: '/reset-password/:token'
});

this.route('edit-account', {
  path: '/edit-account/:user_id'
});

Include Default CSS Styling

To include default css styling, add the following to your ember-cli projects Brocfile.js:

var app = new EmberApp({
  emberAuthenticateMe: {
      importCSS: true
    },
  ...
]);

Override default login transitions

override the app/controllers/login.js controller to:

import LoginController from 'ember-authenticate-me/controllers/login';

export default LoginController.extend({
  transitionRoute: /* route name here, I.E. 'foo' */

  transitionToLoggedInRoute: function(sessionContent) {
    /*
     * Or to dynamically control the transition
     * implement this function here and manually
     * call `this.transitionToRoute(...);
     */
  }
});

Watching session lifecycle events

An example on adding user context to sentry. app/instance-initializers/sentry.js

export function initialize(applicationInstance) {
  const sessionLifecycle = applicationInstance.lookup('service:session-lifecycle');

  sessionLifecycle.registerLoginCallback((session) => {
    if (!Ember.isBlank(session.currentUser)) {
      Raven.setUserContext({ email: session.currentUser.get('email'), id: session.currentUser.get('id') });
    }
  });

  sessionLifecycle.registerLogoutCallback((session) => {
    Raven.setUserContext();
  });
}

For more information on using ember-cli, visit http://www.ember-cli.com/.


Code Of Conduct

Wildland Open Source Code Of Conduct

0.8.1

6 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.2.0

8 years ago

0.1.0

9 years ago

0.0.19

9 years ago

0.0.18

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago