header('X-Inertia') && $this->shouldConfirmPassword($request, $passwordTimeoutSeconds)) { return $this->inertiaRefusal($request); } return parent::handle($request, $next, $redirectToRoute, $passwordTimeoutSeconds); } private function inertiaRefusal(Request $request): Response { $user = $request->user(); return $this->responseFactory->json([ 'message' => 'Password confirmation required.', // The same question the confirm-password screen asks: an account // provisioned by a provider has no password to type, and the // dialog has to offer it a way to set one instead. 'has_local_password' => $user?->auth_source === AuthSource::Local, ], 423, [self::HEADER => 'required']); } }