@@ -31,13 +31,13 @@ final class LoginLinkHandler implements LoginLinkHandlerInterface
31
31
private UrlGeneratorInterface $ urlGenerator ;
32
32
private UserProviderInterface $ userProvider ;
33
33
private array $ options ;
34
- private SignatureHasher $ signatureHashUtil ;
34
+ private SignatureHasher $ 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 ,
@@ -52,7 +52,7 @@ public function createLoginLink(UserInterface $user, Request $request = null): L
52
52
$ parameters = [
53
53
'user ' => $ user ->getUserIdentifier (),
54
54
'expires ' => $ expires ,
55
- 'hash ' => $ this ->signatureHashUtil ->computeSignatureHash ($ user , $ expires ),
55
+ 'hash ' => $ this ->signatureHasher ->computeSignatureHash ($ user , $ expires ),
56
56
];
57
57
58
58
if ($ request ) {
@@ -93,7 +93,7 @@ public function consumeLoginLink(Request $request): UserInterface
93
93
$ expires = $ request ->get ('expires ' );
94
94
95
95
try {
96
- $ this ->signatureHashUtil ->verifySignatureHash ($ user , $ expires , $ hash );
96
+ $ this ->signatureHasher ->verifySignatureHash ($ user , $ expires , $ hash );
97
97
} catch (ExpiredSignatureException $ e ) {
98
98
throw new ExpiredLoginLinkException (ucfirst (str_ireplace ('signature ' , 'login link ' , $ e ->getMessage ())), 0 , $ e );
99
99
} catch (InvalidSignatureException $ e ) {
0 commit comments