fix reset password
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 49s
Tests / PHPUnit (push) Failing after 1m20s

This commit is contained in:
root
2026-08-26 20:45:23 -04:00
parent 9899af7b37
commit a354d78fa9
11 changed files with 88 additions and 25 deletions
+9 -1
View File
@@ -459,6 +459,8 @@ class UserController extends BaseController
// --- Handle unknown or unverified email ---
if (!$user || (int) $user['is_verified'] === 0) {
session()->setFlashdata('success', 'If this email is registered, you will receive a reset link.');
session()->setFlashdata('show_modal', true);
session()->setFlashdata('email', $email);
log_message('info', "Password reset requested for {$email} (user missing or unverified).");
return redirect()->back();
}
@@ -478,6 +480,8 @@ class UserController extends BaseController
$this->sendResetEmail($email, $token);
session()->setFlashdata('success', 'A password reset link has been sent to your email.');
session()->setFlashdata('show_modal', true);
session()->setFlashdata('email', $email);
log_message('info', "Password reset email sent to {$email}");
return redirect()->back();
@@ -633,14 +637,18 @@ class UserController extends BaseController
$ipAttemptModel->where('ip_address', $ipAddress)->delete();
}
$this->resetRequestModel->where('ip_address', $ipAddress)->delete();
// Redirect to a success page with a success message
return view('user/password_set_success');
return redirect()->to('/user/password_set_success');
}
public function passwordSetSuccess()
{
$this->resetRequestModel->where('ip_address', $this->request->getIPAddress())->delete();
return view('user/password_set_success');
}