Contao\CoreBundle\Security\Authentication\ContaoToken::__construct PHP Method

__construct() public method

Constructor.
public __construct ( User $user )
$user Contao\User
    public function __construct(User $user)
    {
        if (!$user->authenticate()) {
            throw new UsernameNotFoundException('Invalid Contao user given.');
        }
        $this->setUser($user);
        $this->setAuthenticated(true);
        parent::__construct($this->getRolesFromUser($user));
    }