Symfony bug in AbstractGuardAuthenticator.php

How to fix a bug in security-guard / AbstractGuardAuthenticator.php.

Mistake:

Argument 3 passed to Symfony Component Security Guard Token PostAuthenticationGuardToken :: __ construct () must be of the type array, null given, called in vendor / symfony / security-guard / AbstractGuardAuthenticator.php on line 35

This means that in the user entity, usually this is the Entity / User.php file, you need to add:

return array(‘ROLE_USER’);

those. So:

public function getRoles()
{
return array(‘ROLE_USER’);
}

Hello! You are on my site. I’m a developer. Here I share my best practices and knowledge. Ask in the comments if you don’t understand something or write if you have something to add.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *