ember-auth-module-auth-redirectable

1.0.3 • Public • Published

auth redirectable module for ember-auth

Build Status Gem Version NPM version

Redirect for protected routes without a signed in session.

Config

App.Auth = Em.Auth.extend
  modules: ['authRedirectable']
 
  authRedirectable:
    # [string] route name to redirect to when accessing a protected route 
    #   without a signed in session 
    route: null

Usage

# this route won't redirect 
App.PublicRoute = Em.Route.extend()
 
# this route will redirect (unless signed in) 
App.ProtectedRoute = Em.Route.extend({ authRedirectable: true })
# call _super() and follow the promise pattern 
# if you override Ember.Route.beforeModel() 
App.FooRoute = Ember.Route.extend
  beforeModel: ->
    @_super.apply(thisarguments).then -> doSomething()
  # or 
  beforeModel: ->
    doSomething()
    @_super.apply(thisarguments) # already returns promise 

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ember-auth-module-auth-redirectable

Weekly Downloads

4

Version

1.0.3

License

MIT

Last publish

Collaborators

  • heartsentwined