No commit activity in last 3 years
No release in over 3 years
Ember-auth auth redirectable module source code wrapper for ruby libs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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(this, arguments).then -> doSomething()
  # or
  beforeModel: ->
    doSomething()
    @_super.apply(this, arguments) # already returns promise

License

MIT