Skip to content

ak_message function not working #5379

@Lanhild

Description

@Lanhild

v2023.4.1, docker-compose

I have the following policy attached to my user write stage:

if "email" in request.context.get("prompt_data", {}):
  # Fetch a user with the same email as the new user being enrolled
  existing_user = ak_user_by(email=request.context["prompt_data"]["email"])

  # If a user with the same email address exists, show a message and deny access
  if existing_user:
    ak_message("An account with this email address already exists. Please use a different email address.")
    return False

# If the email is unique or 'email' is not in prompt_data context, allow the access
return True

That is supposed to show the message in ak_message when the policy fails. Though, it is not sending my message but a generic Failed to save user

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions