Convenience route that bundles some of the auth route mixins. It essentially handles redirects and everything to ensure that only users who are authenticated can access the route. It also handles redirecting to index route if the user has no roles within the app.

Usage: (in a routes file)

import AuthRoute from './auth';

export default AuthRoute.extend({
    // your code here...
});

Basically all of the routes in your app should extend AuthRoute (or RestrictedRoute if only certain roles have access to that page) unless you want the route to be accessible even if the user is not logged in.

Show:

Methods

Properties

permit
(
  • roles
  • goTo
)
Ember.Transition | Null
public

Checks a role or list of roles against a user's available roles. If the check fails, the app will transition to the route specified.

Parameters:

  • roles String | Array

    Roles to check

  • goTo String

    Route to transition to if the check fails

Returns:

Ember.Transition | Null

rejectedRoute

String public

Route to transition to if the check (for authentication and having roles) fails. This should ordinarily be left to the default, but could be overwritten if the need arose.


Default: index