Skip to content

Commit cfe1474

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [Security] Make `impersonation_path()` argument mandatory and add `impersonation_url()`
2 parents 751ed77 + aacb804 commit cfe1474

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Impersonate/ImpersonateUrlGenerator.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,20 @@ public function __construct(RequestStack $requestStack, FirewallMap $firewallMap
3636
$this->firewallMap = $firewallMap;
3737
}
3838

39-
public function generateImpersonationPath(string $identifier = null): string
39+
public function generateImpersonationPath(string $identifier): string
4040
{
4141
return $this->buildPath(null, $identifier);
4242
}
4343

44+
public function generateImpersonationUrl(string $identifier): string
45+
{
46+
if (null === $request = $this->requestStack->getCurrentRequest()) {
47+
return '';
48+
}
49+
50+
return $request->getUriForPath($this->buildPath(null, $identifier));
51+
}
52+
4453
public function generateExitPath(string $targetUri = null): string
4554
{
4655
return $this->buildPath($targetUri);

0 commit comments

Comments
 (0)