validated(); if (!Hash::check( $validated['currentPassword'], Auth::user()->password) ) { Log::notice('Password update failed: wrong password provided'); return response()->json(['message' => __('errors.wrong_current_password')], 400); } if (!config('2fauth.config.isDemoApp') ) { $request->user()->update([ 'password' => bcrypt($validated['password']), ]); Log::info('User password updated'); } return response()->json(['message' => __('auth.forms.password_successfully_changed')]); } }