11
11
/**
12
12
* Users management.
13
13
*/
14
- final class UserManager implements Nette \Security \IAuthenticator
14
+ final class UserManager implements Nette \Security \Authenticator
15
15
{
16
16
use Nette \SmartObject;
17
17
@@ -24,12 +24,12 @@ final class UserManager implements Nette\Security\IAuthenticator
24
24
COLUMN_ROLE = 'role ' ;
25
25
26
26
27
- private Nette \Database \Context $ database ;
27
+ private Nette \Database \Explorer $ database ;
28
28
29
29
private Passwords $ passwords ;
30
30
31
31
32
- public function __construct (Nette \Database \Context $ database , Passwords $ passwords )
32
+ public function __construct (Nette \Database \Explorer $ database , Passwords $ passwords )
33
33
{
34
34
$ this ->database = $ database ;
35
35
$ this ->passwords = $ passwords ;
@@ -40,7 +40,7 @@ public function __construct(Nette\Database\Context $database, Passwords $passwor
40
40
* Performs an authentication.
41
41
* @throws Nette\Security\AuthenticationException
42
42
*/
43
- public function authenticate (array $ credentials ): Nette \Security \IIdentity
43
+ public function authenticate (array $ credentials ): Nette \Security \SimpleIdentity
44
44
{
45
45
[$ username , $ password ] = $ credentials ;
46
46
@@ -62,7 +62,7 @@ public function authenticate(array $credentials): Nette\Security\IIdentity
62
62
63
63
$ arr = $ row ->toArray ();
64
64
unset($ arr [self ::COLUMN_PASSWORD_HASH ]);
65
- return new Nette \Security \Identity ($ row [self ::COLUMN_ID ], $ row [self ::COLUMN_ROLE ], $ arr );
65
+ return new Nette \Security \SimpleIdentity ($ row [self ::COLUMN_ID ], $ row [self ::COLUMN_ROLE ], $ arr );
66
66
}
67
67
68
68
0 commit comments