Set sessionId at the same time as isLoggedIn.
Showing
1 changed file
with
4 additions
and
2 deletions
... | @@ -179,13 +179,15 @@ define(function(require) { | ... | @@ -179,13 +179,15 @@ define(function(require) { |
179 | function applyLoginResults(resultData) { | 179 | function applyLoginResults(resultData) { |
180 | var userData = resultData.user; | 180 | var userData = resultData.user; |
181 | var user = self.get('user'); | 181 | var user = self.get('user'); |
182 | self.set('isLoggedIn', !!userData); | 182 | self.set({ |
183 | isLoggedIn: !!userData, | ||
184 | sessionId: resultData.sessionId, | ||
185 | }); | ||
183 | if (userData) { | 186 | if (userData) { |
184 | user.set(userData); | 187 | user.set(userData); |
185 | } else { | 188 | } else { |
186 | user.clear(); | 189 | user.clear(); |
187 | } | 190 | } |
188 | self.set('sessionId', resultData.sessionId); | ||
189 | var permissions = self.get('permissions'); | 191 | var permissions = self.get('permissions'); |
190 | var toErase = {}, toSet = {}; | 192 | var toErase = {}, toSet = {}; |
191 | _.each(permissions.keys(), function(key) { | 193 | _.each(permissions.keys(), function(key) { | ... | ... |
-
Please register or sign in to post a comment