Catchable Fatal Error: Argument 4 passed to UsernamePasswordToken::__construct() must be an array, null given

前端 未结 3 548
小蘑菇
小蘑菇 2021-01-11 18:42

I am getting the following error when logging in into my Symfony application (with correct username and password):

ContextErrorException: Catchable Fa

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-11 19:33

    This error is catching because the roles property current provided value is null however you have to give it an array of roles, so to resolve it just return the roles propoerty :

    public function getRoles()
    {
        return $this->roles;
    }
    

提交回复
热议问题