fix reset password
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user