header('X-Inertia') && $this->shouldConfirmPassword($request, $timeout)) { 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, and see // there for why it is Social and not "anything but Local": 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_password' => $user !== null && $user->auth_source !== AuthSource::Social, ], 423, [self::HEADER => 'required']); } }