Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

Commit

Permalink
do not break if token has no method getProviderKey()
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Apr 13, 2020
1 parent 96de1df commit 6d5637c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Controller/RegistrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ public function confirmedAction(Request $request)
*/
private function getTargetUrlFromSession(SessionInterface $session)
{
$key = sprintf('_security.%s.target_path', $this->tokenStorage->getToken()->getProviderKey());
$token = $this->tokenStorage->getToken();
if (!method_exists($token, 'getProviderKey')) {
return null;
}

$key = sprintf('_security.%s.target_path', $token->getProviderKey());

if ($session->has($key)) {
return $session->get($key);
Expand Down

0 comments on commit 6d5637c

Please sign in to comment.