Skip to Content
HomeLink Hub

Account and Settings

The Account page, covering profile details, identity verification, notification preferences, password, two-factor authentication and account deletion.

The Account page has three tabs: Profile, Notifications and Security. It reads the user from localStorage first so the form is filled instantly, then replaces those values with the profile from the API.

Where it lives

RouteView / component fileAccess
/app/accountsrc/views/app/account.tsxsigned-in
Identity verification dialogsrc/components/kyc/youverify-modal.tsxsigned-in

Requests are in src/services/user/user-thunk.ts (RTK Query userApi, base path /api/v1/user, cache tag User).

Before you start

  • Signed in. The page fires GET /api/v1/user/profile on open.
  • Changing the password, disabling two-factor authentication and deleting the account each need the current password.

Flow

Update personal information (Profile tab)

  1. The header shows the avatar, the full name and a "Verified Account" label.
  2. Personal Information has five fields: First Name, Last Name, Email Address, Phone Number and City. None has client-side validation.
  3. Save Changes (reads "Saving..." while busy) fires PUT /api/v1/user/personal-info with firstName, lastName and phone.
  4. On success the stored user in localStorage is updated with the same three values and the profile is refetched. There is no success toast.
  5. On failure nothing is shown to the user; the error is only logged to the browser console.

Email and City are not saved

The Email Address and City fields can be edited, but Save Changes only sends first name, last name and phone. Edits to the other two are discarded on the next load. Also not wired up: the camera button on the avatar has no handler, and the "Verified Account" label is fixed text that does not reflect email or KYC status.

Verify identity (Profile tab)

  1. The Identity Verification card shows KYC Status. Unverified users see "Verify your identity to unlock all features." and Verify Now; verified users see "Your identity has been verified." and a Verified badge. The value comes from isKYCVerified on the profile.
  2. Verify Now opens the dialog "Identity Verification".
  3. Field National Identity Number (NIN): digits only, exactly 11. Other characters are stripped as the user types and the submit button stays disabled until there are 11 digits. Submitting any other length shows the toast "Please enter a valid 11-digit NIN."
  4. Verify Identity (reads "Verifying..." while busy) fires POST /api/v1/auth/kyc/verify with kycType: "NIN" and nin.
  5. Success: toast "Identity verified successfully!", the dialog closes and the profile refetches, so the card switches to Verified.
  6. Failure: a toast with the server's message, or "Verification failed. Please check your NIN and try again."

The dialog states that the NIN "is securely verified directly against the NIMC database via Youverify".

Notification preferences (Notifications tab)

  1. A grid lists five notification types against three channels: In-app, Email and SMS. The SMS column is labelled "Soon", always shows off and cannot be clicked.
TypeDescription shownDefault In-appDefault Email
New property matchesGet notified when a new listing matches your searchonon
Escrow updatesReal-time updates on your transaction progressonon
Agent messagesReceive messages from agents and landlordsonon
Price drop alertsGet notified when a saved property drops in priceoffon
Promotional emailsNews, tips, and offers from Homelink Huboffon
  1. Saved values from the profile's notificationPreferences replace the defaults when the profile loads.
  2. There is no save button. Two seconds after the last toggle the app fires PUT /api/v1/user/notification-preferences with all five types, each as an object of inApp, email and sms flags.
  3. Failures are logged to the console only; the switches keep their new position.

The same debounced save also fires about two seconds after the page opens and again after the profile loads, even if nothing was changed.

Change password (Security tab)

  1. Fields: Current Password, New Password and Confirm New Password.
  2. Update Password (reads "Updating..." while busy) checks, in order: all three filled ("All fields are required"), the two new values match ("New passwords do not match"), and the new password has at least 4 characters ("New password must be at least 4 characters").
  3. It fires POST /api/v1/user/change-password with currentPassword and newPassword.
  4. Success: the fields clear and "Password changed successfully!" shows for 3 seconds. The user stays signed in.
  5. Failure: the server's message, or "Failed to change password", shows under the fields.
The Security tab of the account page, with the Change Password form.
The Security tab of the account page, with the Change Password form.

Two-factor authentication (Security tab)

  1. Under Security Options, the Two-Factor Authentication row shows Enabled or Disabled from twoFactorEnabled on the profile. Clicking it opens a modal.
  2. Enable: the modal "Enable Two-Factor Authentication" has no fields. Enable fires POST /api/v1/user/enable-2fa.
  3. Disable: the modal "Disable Two-Factor Authentication" asks for Password ("Password is required" when empty). Disable fires POST /api/v1/user/disable-2fa with password.
  4. On success the modal closes. On failure the server's message, or "Failed to update 2FA", shows in the modal.

Two-factor setup looks incomplete

The enable response includes a secret, but the UI never shows it or a QR code, and there is no step to enter a code. Neither call refetches the profile, so the row keeps its old Enabled or Disabled label until the page is reloaded. The sign-in form also has no step for entering a two-factor code.

Delete account (Security tab)

  1. Click Delete Account. The modal warns "This action cannot be undone. All your data will be permanently deleted. Please enter your password to confirm."
  2. Enter Password ("Password is required" when empty) and click Delete Account (reads "Deleting..." while busy).
  3. The app fires DELETE /api/v1/user/account with password in the request body.
  4. Success: the browser is sent to / with a full page load.
  5. Failure: the server's message, or "Failed to delete account", shows in the modal.

Local session is not cleared after deletion

The delete handler does not remove the token, refresh token or user from storage before redirecting. Until the next API call returns a token error, the navbar can still show the deleted user as signed in.

States and edge cases

  • Loading. There is no spinner; the form shows the stored user until the profile arrives.
  • Profile request fails. No error is shown. The form keeps the stored values and the KYC card shows the unverified state.
  • Active Sessions. The row is present ("View and manage devices logged into your account") but clicking it does nothing; it is marked as a to-do in the code.
  • Password rule mismatch. This form accepts 4 characters, while sign-up needs 8 and the reset page needs 8 with mixed case, a number and a symbol. The backend's own rule decides what is finally accepted.
  • Signed out. The page renders with empty fields; the profile request fails or redirects to sign-in.

What happens next

  • A changed name or phone shows in the navbar after the next render, since the navbar reads the stored user.
  • Notification preferences are read by the backend when it decides which channels to use; the in-app column covers both the Notifications page and phone push.
  • Identity verification sets isKYCVerified on the account. This app does not gate any of its own screens on it.

On this page