Set c.user when logging in

This fixes an issue with PostController.login where we didn't know
the user's HTTPS preferences at the point when they logged in
This commit is contained in:
Jordan Milne
2014-08-05 22:16:38 -03:00
committed by Neil Williams
parent b4df9a6781
commit 1d148afbe1

View File

@@ -517,6 +517,8 @@ class ApiController(RedditController):
AJAX login handler, used by both login and register to set the
user cookie and send back a redirect.
"""
c.user = user
c.user_is_loggedin = True
self.login(user, rem = rem)
if request.params.get("hoist") != "cookie":
@@ -608,7 +610,6 @@ class ApiController(RedditController):
if any(reject):
return
c.user = user
self._login(responder, user, rem)
@cross_domain(allow_credentials=True)