mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 06:48:01 -05:00
password reset: Validate token before affecting user session.
Thanks to /u/largenocream for reporting this.
This commit is contained in:
@@ -1245,17 +1245,18 @@ class FormsController(RedditController):
|
||||
to verify their identity before allowing them to update their
|
||||
password."""
|
||||
|
||||
#if another user is logged-in, log them out
|
||||
if c.user_is_loggedin:
|
||||
self.logout()
|
||||
return self.redirect(request.path)
|
||||
|
||||
done = False
|
||||
if not key and request.referer:
|
||||
referer_path = request.referer.split(g.domain)[-1]
|
||||
done = referer_path.startswith(request.fullpath)
|
||||
elif not token:
|
||||
return self.redirect("/password?expired=true")
|
||||
else:
|
||||
#if another user is logged-in, log them out
|
||||
if c.user_is_loggedin:
|
||||
self.logout()
|
||||
return self.redirect(request.path)
|
||||
|
||||
return BoringPage(_("reset password"),
|
||||
content=ResetPassword(key=key, done=done)).render()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user