Skip to content

Commit 2ed1e40

Browse files
committed
Update Google OAuth prompt to 'consent select_account'
Changed the default OAuth prompt in config, documentation, and client initialization from 'auto' or 'force' to 'consent select_account' to ensure users are always prompted for consent and account selection. This improves clarity and aligns with current Google OAuth best practices.
1 parent 26a0060 commit 2ed1e40

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

config/google.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'redirect_uri' => env('GOOGLE_REDIRECT', ''),
2323
'scopes' => [],
2424
'access_type' => 'online',
25-
'prompt' => 'auto',
25+
'prompt' => 'consent select_account',
2626

2727
/*
2828
|----------------------------------------------------------------------------

docs/oauth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Update your `config/google.php`:
6060
\Google\Service\Drive::DRIVE,
6161
],
6262
'access_type' => 'offline', // Required for refresh tokens
63-
'approval_prompt' => 'force', // Force consent to get refresh token
63+
'prompt' => 'consent select_account',
6464
```
6565

6666
## Step 4: Install and Configure Laravel Socialite

lib/google/GoogleApiClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(#[\SensitiveParameter] array $config, string $userEm
3333

3434
// only allow prompt or approval_prompt
3535
if (Arr::has($config, 'prompt')) {
36-
$this->client->setPrompt(Arr::get($config, 'prompt', 'auto'));
36+
$this->client->setPrompt(Arr::get($config, 'prompt', 'consent select_account'));
3737
} elseif (Arr::has($config, 'approval_prompt')) {
3838
$this->client->setApprovalPrompt(Arr::get($config, 'approval_prompt', 'auto'));
3939
}

0 commit comments

Comments
 (0)