10000 [Workflow] There are no tokens available for workflow "%s" (new security system) · Issue #39505 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Workflow] There are no tokens available for workflow "%s" (new security system) #39505
Closed
@lugus

Description

@lugus

Symfony version(s) affected: 5.2.0

Description
After migration to the new security system, it looks that it's not possible anymore to apply transition as an anonymous because no token is available (previously we had the AnonymousToken).

How to reproduce

  • Use the new security system.

  • Had a workflow like:

framework:
    workflows:
        user_account:
            type: 'workflow'
            supports:
                - Lugosium\Bundle\InpulsarBundle\Entity\UserAccount
            initial_marking: pending_activation
            places:
                pending_activation: ~
                enabled: ~
            transitions:
                pending_activation_to_enabled:
                    from: pending_activation
                    to: enabled

Apply transition pending_activation_to_enabled as anonymous.

Possible Solution
Support null token in:

https://github.com/symfony/workflow/blob/5.x/EventListener/GuardListener.php#L80

Additional context
User registers and his account is marked as pending_activation.
When he clicks email link to activate account, i used to apply transition pending_activation_to_enabled and then redirect user to the login page.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0