Make it so that our error responses to login attempts are legible to the user.
This commit is contained in:
parent
7f4a66be99
commit
1f8a82eefe
1 changed files with 3 additions and 3 deletions
|
@ -63,14 +63,14 @@ def create_user():
|
|||
model.load_token_data(password)
|
||||
return make_response('Verified', 201)
|
||||
except model.InvalidTokenException:
|
||||
abort(401)
|
||||
return make_response('Invalid access token.', 400)
|
||||
|
||||
elif '+' in username:
|
||||
try:
|
||||
model.verify_robot(username, password)
|
||||
return make_response('Verified', 201)
|
||||
except model.InvalidRobotException:
|
||||
abort(401)
|
||||
return make_response('Invalid robot account or password.', 400)
|
||||
|
||||
existing_user = model.get_user(username)
|
||||
if existing_user:
|
||||
|
@ -78,7 +78,7 @@ def create_user():
|
|||
if verified:
|
||||
return make_response('Verified', 201)
|
||||
else:
|
||||
abort(401)
|
||||
return make_response('Invalid password.', 400)
|
||||
else:
|
||||
# New user case
|
||||
new_user = model.create_user(username, password, user_data['email'])
|
||||
|
|
Reference in a new issue