Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve action_token in safe mode #909

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading