From 1238caf3186cc430aced02e58820910284dae669 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 23 Jun 2014 15:15:40 +0200 Subject: [PATCH] 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. --- assets/scripts/app/auth.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/scripts/app/auth.coffee b/assets/scripts/app/auth.coffee index da574729..43b88517 100644 --- a/assets/scripts/app/auth.coffee +++ b/assets/scripts/app/auth.coffee @@ -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'