Skip to content

Commit

Permalink
Retrieve action_token in safe mode (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbelletti committed Aug 17, 2024
1 parent ec7a03a commit 62a50fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py4web/utils/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,11 @@ def login(self, email, password):
# then check for possible login blockers
if not user:
error = "invalid_credentials"
elif (user["action_token"] or "").startswith("pending-registration:"):
elif (user.get("action_token") or "").startswith("pending-registration:"):
error = "registration_is_pending"
elif user["action_token"] == "account-blocked":
elif user.get("action_token") == "account-blocked":
error = "account_is_blocked"
elif user["action_token"] == "pending-approval":
elif user.get("action_token") == "pending-approval":
error = "account_needs_to_be_approved"

# return the error or the user
Expand Down

0 comments on commit 62a50fb

Please sign in to comment.