user(); $props = [ 'canManageTwoFactor' => Features::canManageTwoFactorAuthentication(), 'mustChangePassword' => (bool) $user->must_change_password_on_next_login, 'status' => session('status'), ]; if (Features::canManageTwoFactorAuthentication()) { $request->ensureStateIsValid(); $props['twoFactorEnabled'] = $user->hasEnabledTwoFactorAuthentication(); $props['requiresConfirmation'] = Features::optionEnabled(Features::twoFactorAuthentication(), 'confirm'); } return Inertia::render('settings/Security', $props); } /** * Update the user's password. */ public function update(PasswordUpdateRequest $request): RedirectResponse { $user = $request->user(); $user->update([ 'must_change_password_on_next_login' => false, 'password' => $request->password, ]); return back(); } }