Skip to content

feat: UserChecker to gate login for pending and blocked users #63

@martinydeAI

Description

@martinydeAI

Tracked under ADR 004 (#60).

Block sign-in for any user whose status is not Approved by
implementing Symfony Security's UserCheckerInterface.

Scope

  • App\Security\AccountStatusChecker implementing
    UserCheckerInterface::checkPreAuth():
    • Pending → throw CustomUserMessageAccountStatusException
      ("security.login.error.pending").
    • Blocked → throw CustomUserMessageAccountStatusException
      ("security.login.error.blocked").
    • Approved → no-op.
  • Wire it on the main firewall in security.yaml via
    user_checker: App\Security\AccountStatusChecker.
  • Add the two translation keys to translations/messages.da.yaml.
  • Tests:
    • direct unit tests for each status branch
    • functional test for the login flow with a Pending user

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions