Show More
@@ -55,7 +55,7 b' CaptchaData = collections.namedtuple(' | |||
|
55 | 55 | 'CaptchaData', 'active, private_key, public_key') |
|
56 | 56 | |
|
57 | 57 | |
|
58 |
def |
|
|
58 | def store_user_in_session(session, username, remember=False): | |
|
59 | 59 | user = User.get_by_username(username, case_insensitive=True) |
|
60 | 60 | auth_user = AuthUser(user.user_id) |
|
61 | 61 | auth_user.set_authenticated() |
@@ -165,7 +165,7 b' class LoginView(BaseAppView):' | |||
|
165 | 165 | auth_info = authenticate( |
|
166 | 166 | '', '', self.request.environ, HTTP_TYPE, skip_missing=True) |
|
167 | 167 | if auth_info: |
|
168 |
headers = |
|
|
168 | headers = store_user_in_session( | |
|
169 | 169 | self.session, auth_info.get('username')) |
|
170 | 170 | raise HTTPFound(c.came_from, headers=headers) |
|
171 | 171 | except UserCreationError as e: |
@@ -186,7 +186,7 b' class LoginView(BaseAppView):' | |||
|
186 | 186 | self.session.invalidate() |
|
187 | 187 | form_result = login_form.to_python(self.request.POST) |
|
188 | 188 | # form checks for username/password, now we're authenticated |
|
189 |
headers = |
|
|
189 | headers = store_user_in_session( | |
|
190 | 190 | self.session, |
|
191 | 191 | username=form_result['username'], |
|
192 | 192 | remember=form_result['remember']) |
General Comments 0
You need to be logged in to leave comments.
Login now