@@ -31,13 +31,13 @@ final class LoginLinkHandler implements LoginLinkHandlerInterface
31
31
private $ urlGenerator ;
32
32
private $ userProvider ;
33
33
private $ options ;
34
- private $ signatureHashUtil ;
34
+ private $ signatureHasher ;
35
35
36
- public function __construct (UrlGeneratorInterface $ urlGenerator , UserProviderInterface $ userProvider , SignatureHasher $ signatureHashUtil , array $ options )
36
+ public function __construct (UrlGeneratorInterface $ urlGenerator , UserProviderInterface $ userProvider , SignatureHasher $ signatureHasher , array $ options )
37
37
{
38
38
$ this ->urlGenerator = $ urlGenerator ;
39
39
$ this ->userProvider = $ userProvider ;
40
- $ this ->signatureHashUtil = $ signatureHashUtil ;
40
+ $ this ->signatureHasher = $ signatureHasher ;
41
41
$ this ->options = array_merge ([
42
42
'route_name ' => null ,
43
43
'lifetime ' => 600 ,
@@ -53,7 +53,7 @@ public function createLoginLink(UserInterface $user, Request $request = null): L
53
53
// @deprecated since Symfony 5.3, change to $user->getUserIdentifier() in 6.0
54
54
'user ' => method_exists ($ user , 'getUserIdentifier ' ) ? $ user ->getUserIdentifier () : $ user ->getUsername (),
55
55
'expires ' => $ expires ,
56
- 'hash ' => $ this ->signatureHashUtil ->computeSignatureHash ($ user , $ expires ),
56
+ 'hash ' => $ this ->signatureHasher ->computeSignatureHash ($ user , $ expires ),
57
57
];
58
58
59
59
if ($ request ) {
@@ -101,7 +101,7 @@ public function consumeLoginLink(Request $request): UserInterface
101
101
$ expires = $ request ->get ('expires ' );
102
102
103
103
try {
104
- $ this ->signatureHashUtil ->verifySignatureHash ($ user , $ expires , $ hash );
104
+ $ this ->signatureHasher ->verifySignatureHash ($ user , $ expires , $ hash );
105
105
} catch (ExpiredSignatureException $ e ) {
106
106
throw new ExpiredLoginLinkException (ucfirst (str_ireplace ('signature ' , 'login link ' , $ e ->getMessage ())), 0 , $ e );
107
107
} catch (InvalidSignatureException $ e ) {
0 commit comments