Skip to content

Commit

Permalink
Merge pull request #1897 from WeCodePixels/1.4
Browse files Browse the repository at this point in the history
Bugfix | Added missing RememberMeBadge into OAuth passport
  • Loading branch information
stloyd authored Jul 21, 2022
2 parents 77498fc + d29affc commit 88455e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OAuth/ResourceOwner/AppleResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function configureOptions(OptionsResolver $resolver)

private static function jwt_decode($id_token)
{
//// from http://stackoverflow.com/a/28748285/624544
// // from http://stackoverflow.com/a/28748285/624544
[, $jwt] = explode('.', $id_token, 3);

// if the token was urlencoded, do some fixes to ensure that it is valid base64 encoded
Expand Down
2 changes: 1 addition & 1 deletion OAuth/Response/SensioConnectUserResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function setData($data)
throw new AuthenticationException('Could not retrieve valid user info.');
}

$this->xpath = new \DOMXpath($dom);
$this->xpath = new \DOMXPath($dom);

$nodes = $this->xpath->evaluate('/api/root');
$user = $this->xpath->query('./foaf:Person', $nodes->item(0));
Expand Down
4 changes: 3 additions & 1 deletion Security/Http/Authenticator/OAuthAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\RememberMeBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;
Expand Down Expand Up @@ -180,7 +181,8 @@ class_exists(UserBadge::class)
method_exists($user, 'getUserIdentifier') ? $user->getUserIdentifier() : $user->getUsername(),
static function () use ($user) { return $user; }
)
: $user
: $user,
[new RememberMeBadge()]
);
}

Expand Down

0 comments on commit 88455e6

Please sign in to comment.