MAPG-181 ability to add login_hint to dialog url
This commit is contained in:
parent
48eba75cf4
commit
f3225ae275
@ -15,7 +15,7 @@ class GoogleOAuth
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function getDialogUrl(string $state, string $redirectUrl): string
|
||||
public function getDialogUrl(string $state, string $redirectUrl, ?string $loginHint = null): string
|
||||
{
|
||||
$oauthParams = [
|
||||
'response_type' => 'code',
|
||||
@ -26,6 +26,10 @@ class GoogleOAuth
|
||||
'nonce' => hash('sha256', random_bytes(10) . microtime()),
|
||||
];
|
||||
|
||||
if ($loginHint !== null) {
|
||||
$oauthParams['login_hint'] = $loginHint;
|
||||
}
|
||||
|
||||
return self::$dialogUrlBase . '?' . http_build_query($oauthParams);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user