Remove auth logic from redirect in Travis.Route
Auth check in redirect duplicates beforeModel logic
This commit is contained in:
parent
8d393c2cf7
commit
9dd198ed75
|
@ -23,19 +23,6 @@ Travis.Route = Ember.Route.extend
|
||||||
signedIn: ->
|
signedIn: ->
|
||||||
@controllerFor('currentUser').get('content')
|
@controllerFor('currentUser').get('content')
|
||||||
|
|
||||||
redirect: ->
|
|
||||||
@auth.autoSignIn() unless @signedIn()
|
|
||||||
|
|
||||||
if @get('needsAuth')
|
|
||||||
@authorize(@router.location.getURL())
|
|
||||||
else
|
|
||||||
@_super.apply this, arguments
|
|
||||||
|
|
||||||
authorize: (path) ->
|
|
||||||
if !@signedIn()
|
|
||||||
@auth.storeAfterSignInPath(path)
|
|
||||||
@transitionTo('auth')
|
|
||||||
|
|
||||||
Travis.ApplicationRoute = Travis.Route.extend
|
Travis.ApplicationRoute = Travis.Route.extend
|
||||||
init: ->
|
init: ->
|
||||||
@_super.apply this, arguments
|
@_super.apply this, arguments
|
||||||
|
|
Loading…
Reference in New Issue
Block a user