Skip to content

Commit

Permalink
ignore auth checks on loading user details during password resets, ck…
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrawnCA authored and duttonw committed Nov 30, 2020
1 parent c04b6d6 commit 437b6bb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ckan/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,12 @@ def _prepare(self, id):
except logic.NotAuthorized:
base.abort(403, _(u'Unauthorized to reset password.'))

context[u'ignore_auth'] = True
try:
user_dict = logic.get_action(u'user_show')(context, {u'id': id})
except logic.NotFound:
base.abort(404, _(u'User not found'))
del context[u'ignore_auth']
user_obj = context[u'user_obj']
g.reset_key = request.params.get(u'key')
if not mailer.verify_reset_link(user_obj, g.reset_key):
Expand Down

0 comments on commit 437b6bb

Please sign in to comment.