Skip to content

Commit

Permalink
Improve error message with product.
Browse files Browse the repository at this point in the history
  • Loading branch information
cslzchen committed Sep 6, 2016
1 parent bb65649 commit 31d08eb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions framework/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ def reset_password_get(auth, uid=None, token=None):
# Check if request bears a valid pair of `uid` and `token`
user_obj = User.load(uid)
if not (user_obj and user_obj.verify_password_token(token=token)):
# TODO: do we want to reveal detailed error message to the client?
error_data = {
'message_short': 'Invalid Request.',
'message_long': 'The request URL is invalid, has been expired or already used',
'message_long': 'The requested URL is invalid, has expired, or was already used',
}
raise HTTPError(http.BAD_REQUEST, data=error_data)

Expand Down Expand Up @@ -89,10 +88,9 @@ def reset_password_post(uid=None, token=None):
# Check if request bears a valid pair of `uid` and `token`
user_obj = User.load(uid)
if not (user_obj and user_obj.verify_password_token(token=token)):
# TODO: do we want to reveal detailed error message to the client?
error_data = {
'message_short': 'Invalid Request.',
'message_long': 'The request URL is invalid, has been expired or already used',
'message_long': 'The requested URL is invalid, has expired, or was already used',
}
raise HTTPError(http.BAD_REQUEST, data=error_data)

Expand Down

0 comments on commit 31d08eb

Please sign in to comment.