Fix signing out on failed try to update user data

A while ago I introduced a change to auth code which signs out user on
failed try to get user data. The problem with it was it signed out on
all kind of errors, like network error. I changed the code to log out on
401 status, but I haven't tested it properly, we actually return 403 on
unauthenticated queries for user data.
This commit is contained in:
Piotr Sarnacki 2014-06-23 15:15:40 +02:00
parent 6cb866408d
commit 1238caf318

View File

@ -74,8 +74,8 @@ window.Auth = Ember.Object.extend
data.user.token = user.token
@storeData(data, Travis.sessionStorage)
@storeData(data, Travis.storage)
, (data, status, xhr) =>
@signOut() if xhr.status == 401
, (status, xhr) =>
@signOut() if status == 403
signedIn: (->
@get('state') == 'signed-in'