File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,40 @@ class AuthServiceProvider extends ServiceProvider
237
237
}
238
238
```
239
239
240
+ You may also extend the built-in ` UserProviderHandler ` implementation if you prefer.
241
+
242
+ For example, if you need to adjust the scopes for a single provider:
243
+
244
+ ``` php
245
+ namespace App\Socialite;
246
+
247
+ use Illuminate\Http\RedirectResponse;
248
+ use Laravel\Socialite\Contracts\Provider;
249
+ use DirectoryTree\Bartender\UserProviderHandler;
250
+
251
+ class MicrosoftUserHandler extends UserProviderHandler
252
+ {
253
+ /**
254
+ * Handle redirecting the user to Microsoft.
255
+ */
256
+ public function redirect(Provider $provider, string $driver): RedirectResponse
257
+ {
258
+ $provider->scopes([
259
+ 'Mail.ReadWrite',
260
+ // ...
261
+ ]);
262
+
263
+ return parent::redirect($provider, $driver);
264
+ }
265
+ }
266
+ ```
267
+
268
+ Then register it as the handler:
269
+
270
+ ``` php
271
+ Bartender::serve('microsoft', MicrosoftUserHandler::class);
272
+ ```
273
+
240
274
### User Creation & Updating
241
275
242
276
If you would like to customize the creation of the user in the default
You can’t perform that action at this time.
0 commit comments