prepare(" SELECT prt.*, c.* FROM password_reset_tokens prt JOIN clients c ON prt.client_id = c.id WHERE prt.token = ? AND prt.expires_at > NOW() AND prt.used = 0 "); $stmt->execute([$token]); $result = $stmt->fetch(); if ($result) { $client = $result; } else { $errors[] = 'This password setup link has expired or is invalid. Please request a new one.'; } } catch (Exception $e) { $errors[] = 'An error occurred. Please try again.'; logClientActivity('Token validation error', ['error' => $e->getMessage()]); } } // Handle password setup form submission if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'setup_password') { $password = $_POST['password'] ?? ''; $confirm_password = $_POST['confirm_password'] ?? ''; $submit_token = $_POST['token'] ?? ''; if (empty($password)) { $errors[] = 'Please enter a password.'; } elseif (strlen($password) < 8) { $errors[] = 'Password must be at least 8 characters long.'; } elseif ($password !== $confirm_password) { $errors[] = 'Passwords do not match.'; } else { try { $pdo = getClientDBConnection(); // Verify token again $stmt = $pdo->prepare(" SELECT prt.*, c.* FROM password_reset_tokens prt JOIN clients c ON prt.client_id = c.id WHERE prt.token = ? AND prt.expires_at > NOW() AND prt.used = 0 "); $stmt->execute([$submit_token]); $result = $stmt->fetch(); if ($result) { // Hash password $password_hash = password_hash($password, PASSWORD_DEFAULT); // Update client password and activate account $stmt = $pdo->prepare(" UPDATE clients SET password = ?, account_status = 'active' WHERE id = ? "); $stmt->execute([$password_hash, $result['client_id']]); // Mark token as used $stmt = $pdo->prepare(" UPDATE password_reset_tokens SET used = 1 WHERE token = ? "); $stmt->execute([$submit_token]); logClientActivity('Password setup successful', [ 'client_id' => $result['client_id'], 'email' => $result['email'] ]); $success = true; } else { $errors[] = 'Invalid or expired token.'; } } catch (Exception $e) { $errors[] = 'An error occurred. Please try again.'; logClientActivity('Password setup error', ['error' => $e->getMessage()]); } } } ?> Set Your Password - Relevant Reflex Client Portal

Relevant Reflex

Client Portal

Password Set Successfully!

Your account is now active. You can log in to the client portal.

Go to Login
Back to Login

Set Your Password

Create a secure password for your client portal account.

Account Information

Company:

Email:

Client Code:

Please fix the following errors:

Password Requirements:

  • At least 8 characters long
  • Mix of letters and numbers recommended
  • Use special characters for extra security
Need help? Contact Support