Skip to content

Commit 86c379a

Browse files
committed
Added setAuthenticated method call in Custom Authentication Provider
1 parent d44b176 commit 86c379a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cookbook/security/custom_authentication_provider.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ provider.
6161
public $created;
6262
public $digest;
6363
public $nonce;
64+
65+
public function __construct(array $roles = array())
66+
{
67+
parent::__construct($roles);
68+
69+
// If the user has roles, consider it authenticated
70+
$this->setAuthenticated(count($roles) > 0);
71+
}
6472
6573
public function getCredentials()
6674
{

0 commit comments

Comments
 (0)