Skip to content

Commit fef99d7

Browse files
Update Passport documentation (#10450)
1 parent 749f980 commit fef99d7

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

‎passport.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,17 @@ public function boot(): void
265265
{
266266
// By providing a view name...
267267
Passport::authorizationView('auth.oauth.authorize');
268-
268+
269269
// By providing a closure...
270-
Passport::authorizationView(fn ($parameters) => Inertia::render('Auth/OAuth/Authorize', [
271-
'request' => $parameters['request'],
272-
'authToken' => $parameters['authToken'],
273-
'client' => $parameters['client'],
274-
'user' => $parameters['user'],
275-
'scopes' => $parameters['scopes'],
276-
]));
270+
Passport::authorizationView(
271+
fn ($parameters) => Inertia::render('Auth/OAuth/Authorize', [
272+
'request' => $parameters['request'],
273+
'authToken' => $parameters['authToken'],
274+
'client' => $parameters['client'],
275+
'user' => $parameters['user'],
276+
'scopes' => $parameters['scopes'],
277+
])
278+
);
277279
}
278280
```
279281

@@ -382,7 +384,7 @@ class Client extends BaseClient
382384
/**
383385
* Determine if the client should skip the authorization prompt.
384386
*
385-
* @param \Laravel\Passport\Scope[] $scopes
387+
* @param \Laravel\Passport\Scope[] $scopes
386388
*/
387389
public function skipsAuthorization(Authenticatable $user, array $scopes): bool
388390
{
@@ -650,7 +652,7 @@ public function boot(): void
650652
// By providing a view name...
651653
Passport::deviceUserCodeView('auth.oauth.device.user-code');
652654
Passport::deviceAuthorizationView('auth.oauth.device.authorize');
653-
655+
654656
// By providing a closure...
655657
Passport::deviceUserCodeView(
656658
fn ($parameters) => Inertia::render('Auth/OAuth/Device/UserCode')
@@ -719,7 +721,7 @@ return $response->json();
719721

720722
This will return a JSON response containing `device_code`, `user_code`, `verification_uri`, `interval`, and `expires_in` attributes. The `expires_in` attribute contains the number of seconds until the device code expires. The `interval` attribute contains the number of seconds the consuming device should wait between requests when polling `/oauth/token` route to avoid rate limit errors.
721723

722-
> [!NOTE]
724+
> [!NOTE]
723725
> Remember, the `/oauth/device/code` route is already defined by Passport. You do not need to manually define this route.
724726
725727
<a name="user-code"></a>
@@ -747,7 +749,7 @@ do {
747749
'client_secret' => 'your-client-secret', // Required for confidential clients only...
748750
'device_code' => 'the-device-code',
749751
]);
750-
752+
751753
if ($response->json('error') === 'slow_down') {
752754
$interval += 5;
753755
}

0 commit comments

Comments
 (0)