Go to user sign in page on token failure

This commit is contained in:
2014-12-24 11:36:19 +01:00
parent da4afbc991
commit 40501f743d
7 changed files with 22 additions and 18 deletions
@@ -11,10 +11,6 @@ App.ApplicationController = Ember.Controller.extend
@set 'notice', null
openDebugger: ->
debugger
evalDebugString: ->
if text = $('#debug-eval-string')
$('.debug-info').append eval(text)
$('.debug-info').append "\n"
currentPathDidChange: (->
@set 'notice', ''
@@ -1,2 +1,10 @@
App.SettingsController = Ember.Controller.extend
locales: ['nl', 'en']
actions:
evalDebugString: ->
if text = $('#debug-eval-string')
result = eval(text)
#result = JSON.stringify(result)
result = result.toString()
$('.debug-info').append result
$('.debug-info').append "\n"
@@ -11,10 +11,11 @@ App.ApplicationRoute = Ember.Route.extend
@setCurrentList()
unauthorized: ->
Qstorage.setItem('auth_token', '')
Qstorage.removeItem('auth_token')
Qstorage.removeItem('user_id')
@controllerFor('application').set 'list', null
@send 'obtain_token'
@controllerFor('application').redirect_to 'index', message: 'unauthorized'
#@send 'obtain_token'
@controllerFor('application').redirect_to 'sign_in', message: 'unauthorized'
handleAuthInfo: (user_id, auth_token)->
Qstorage.setItem 'user_id', user_id