signOut on refresh user data error

This commit is contained in:
Piotr Sarnacki 2014-04-09 00:11:18 +02:00
parent 433f5b7318
commit 1d06666357
2 changed files with 4 additions and 2 deletions

View File

@ -82,6 +82,8 @@
data.user.token = user.token
@storeData(data, Travis.sessionStorage)
@storeData(data, Travis.storage)
, (data, status, xhr) =>
@signOut()
signedIn: ->
@get('state') == 'signed-in'

View File

@ -7,8 +7,8 @@ Travis.ajax = Em.Object.create
accepts:
json: 'application/json; version=2'
get: (url, callback) ->
@ajax(url, 'get', success: callback)
get: (url, callback, errorCallback) ->
@ajax(url, 'get', success: callback, error: errorCallback)
post: (url, data, callback) ->
@ajax(url, 'post', data: data, success: callback)