OAuth: Fix error when user id is numeric

This commit is contained in:
Igor Scheller 2023-07-25 19:00:56 +02:00 committed by Michael Weimann
parent 24f958b00d
commit e407a3b780
2 changed files with 6 additions and 6 deletions

View File

@ -54,7 +54,7 @@ class OAuthController extends BaseController
if (!$request->has('code')) {
$authorizationUrl = $provider->getAuthorizationUrl(
[
// Leauge separates scopes by comma, which is wrong, so we do it
// League oauth separates scopes by comma, which is wrong, so we do it
// here properly by spaces. See https://www.rfc-editor.org/rfc/rfc6749#section-3.3
'scope' => join(' ', $config['scope'] ?? []),
]
@ -101,7 +101,7 @@ class OAuthController extends BaseController
->where('provider', $providerName)
->where('identifier', $resourceId)
->get()
// Explicit case sensitive comparison using PHP as some DBMS collations are case sensitive and some arent
// Explicit case-sensitive comparison using PHP as some DBMS collations are case-sensitive and some aren't
->where('identifier', '===', (string) $resourceId)
->first();
@ -150,7 +150,7 @@ class OAuthController extends BaseController
if (!$oauth) {
return $this->redirectRegister(
$providerName,
$resourceId,
(string) $resourceId,
$accessToken,
$config,
$userdata

View File

@ -408,7 +408,7 @@ class OAuthControllerTest extends TestCase
$resourceOwner,
'getId',
null,
'ProVIdeR-User-IdenTifIer', // Case sensitive variation of existing entry
'ProVIdeR-User-IdenTifIer', // case-sensitive variation of existing entry
$this->atLeastOnce()
);
$this->setExpects(
@ -508,7 +508,7 @@ class OAuthControllerTest extends TestCase
null,
[
'nested' => [
'id' => 'new-provider-user-identifier',
'id' => 42, // new provider user identifier
'name' => 'testuser',
'email' => 'foo.bar@localhost',
'first' => 'Test',