guard->guest()) { $prompt = $request->string('prompt')->explode(' ')->map(trim(...))->filter()->values(); // prompt=none must not show a login UI — fall through to Passport. if ($prompt->doesntContain('none')) { $this->promptForLogin($request); } } try { return parent::authorize($psrRequest, $request, $psrResponse, $viewResponse); } catch (OAuthServerException $exception) { if ($request->expectsJson() || $exception->getResponse()->isRedirection()) { throw $exception; } $oauth = $exception->getPrevious(); return Inertia::render('mcp/AuthorizeError', $oauth instanceof LeagueOAuthServerException ? [ 'error' => $oauth->getErrorType(), 'errorDescription' => $oauth->getMessage(), ] : [ 'error' => 'server_error', 'errorDescription' => __('mcp.authorize.error_body'), ])->toResponse($request); } } /** * @param Scope[] $scopes */ protected function hasGrantedScopes(Authenticatable $user, Client $client, array $scopes): bool { return false; } }