Closed
Description
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.