diff --git a/src/OAuth/GoogleOAuth.php b/src/OAuth/GoogleOAuth.php index c339179..5f78ee2 100644 --- a/src/OAuth/GoogleOAuth.php +++ b/src/OAuth/GoogleOAuth.php @@ -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); }