redirect to home from profile on sign out
This commit is contained in:
parent
a1d5b8b878
commit
15d7406d71
|
@ -43,6 +43,7 @@ Travis.reopen
|
||||||
|
|
||||||
signOut: ->
|
signOut: ->
|
||||||
@get('auth').signOut()
|
@get('auth').signOut()
|
||||||
|
@get('router').send('showAuthenticated')
|
||||||
|
|
||||||
receive: ->
|
receive: ->
|
||||||
@store.receive.apply(@store, arguments)
|
@store.receive.apply(@store, arguments)
|
||||||
|
|
|
@ -16,35 +16,32 @@ Travis.Router = Ember.Router.extend
|
||||||
showUserProfile: Ember.Route.transitionTo('root.profile.account.profile')
|
showUserProfile: Ember.Route.transitionTo('root.profile.account.profile')
|
||||||
|
|
||||||
signedIn: ->
|
signedIn: ->
|
||||||
!!Travis.app.get('currentUser')
|
!!Travis.app.get('auth.user')
|
||||||
|
|
||||||
requiresAuth: (path) ->
|
requiresAuth: (path) ->
|
||||||
# TODO: not sure what the path is at the moment
|
|
||||||
path == '/profile' && !@signedIn()
|
path == '/profile' && !@signedIn()
|
||||||
|
|
||||||
loading: Ember.Route.extend
|
loading: Ember.Route.extend
|
||||||
routePath: (router, path) ->
|
routePath: (router, path) ->
|
||||||
router.set('lastAttemptedPath', path)
|
router.set('lastAttemptedPath', path)
|
||||||
if router.requiresAuth(path)
|
if router.requiresAuth(path)
|
||||||
router.send 'switchToUnauthenticated'
|
router.send 'showUnauthenticated'
|
||||||
else
|
else
|
||||||
router.send 'switchToAuthenticated'
|
router.send 'showAuthenticated'
|
||||||
|
|
||||||
switchToUnauthenticated: Ember.State.transitionTo('unauthenticated.index')
|
# showUnauthenticated: Ember.State.transitionTo('unauthenticated.index')
|
||||||
switchToAuthenticated: Ember.State.transitionTo('authenticated.index')
|
showUnauthenticated: Ember.State.transitionTo('root.home.show')
|
||||||
|
showAuthenticated: Ember.State.transitionTo('authenticated.index')
|
||||||
|
|
||||||
unauthenticated: Ember.Route.extend
|
# unauthenticated: Ember.Route.extend
|
||||||
index: Ember.Route.extend
|
# index: Ember.Route.extend
|
||||||
route: '/'
|
# route: '/'
|
||||||
|
# connectOutlets: (router) ->
|
||||||
connectOutlets: (router) ->
|
# router.transitionTo('login')
|
||||||
router.transitionTo('login')
|
# login: Ember.Route.extend
|
||||||
|
# route: '/login'
|
||||||
login: Ember.Route.extend
|
# connectOutlets: (router) ->
|
||||||
route: '/login'
|
# router.get('applicationController').connectOutlet('login')
|
||||||
|
|
||||||
connectOutlets: (router) ->
|
|
||||||
router.get('applicationController').connectOutlet('login')
|
|
||||||
|
|
||||||
authenticated: Ember.Route.extend
|
authenticated: Ember.Route.extend
|
||||||
index: Ember.Route.extend
|
index: Ember.Route.extend
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user