Skip to Content
HomeLink Hub

Sign in and password reset

Email and password sign-in, Google sign-in, forgotten passwords and signing out.

Where it lives

RouteView fileAccess
/auth/signinsrc/views/auth/signin.tsxpublic
/auth/google/callbacksrc/views/auth/google-callback.tsxpublic (Google redirects here)
/auth/forgot-passwordsrc/views/auth/forgot-password.tsxpublic
/auth/reset-passwordsrc/views/auth/reset-password.tsxpublic (opened from the reset email)

Sign-out has no route of its own. It lives in src/components/topbar.tsx and src/components/global-search.tsx. All API calls are thunks in src/services/auth/auth-thunk.ts; the role check is in src/config/roles.ts.

Before you start

  • An account with the role agent, landlord or lawyer.
  • For Google sign-in, an account the API can match to the Google profile.

Flow

Sign in with email and password

The card is headed "Welcome Back" with "Sign in to manage your listings, clients and deals." It is a two-step form on one route.

  1. Email step. Enter Email Address and press Continue.

    RuleMessage
    Empty"Email address is required"
    Must match something@something.something with no spaces"Enter a valid email address"

    This step also shows Continue with Google and "Don't have an account? Create one" (goes to /auth/signup).

  2. Password step. The email is shown with a Change link back to step 1. Enter Password (eye button toggles visibility) and press Sign In. An empty password shows "Password is required". Forgot Password? goes to /auth/forgot-password.

  3. The app sends POST /api/v1/auth/signin with email (trimmed) and password. The button is disabled and shows a spinner while the request runs.

  4. On success the thunk stores the response:

    ValueKept in
    data.accessTokensessionStorage key token
    data.refreshTokenlocalStorage key refreshToken
    data.userlocalStorage key user, and Redux state.auth.user
  5. Role check. If the stored user's role is not AGENT, LANDLORD or LAWYER, the three values are removed again, a toast says "This app is for agents, landlords, and legal partners. Redirecting you to the HomeLinkHub app…" and the browser is sent to the consumer app's /auth/signin.

  6. Otherwise a toast says "Welcome back!" and, two seconds later, the app navigates:

    WhoLands on
    Agent whose isKYCVerified is false/onboarding
    Lawyer/legal
    Everyone elseThe saved callback URL (localStorage key hl_callback_url) if there is one, otherwise /

    The callback URL is read and removed in the same step, whoever signs in.

  7. On failure a toast shows the API message, or "Sign in failed. Please try again." The user stays on the password step.

No two-factor step at sign-in

Settings has a two-factor toggle (see Settings), but the sign-in screen has no code prompt. A successful POST /api/v1/auth/signin is treated as fully signed in.

Sign in with Google

  1. On the email step press Continue with Google. The app sends GET /api/v1/auth/google?app=true.
  2. If the response contains data.authUrl, the browser leaves the app for that URL (Google's consent screen).
  3. Google returns to /auth/google/callback?code=...&state=.... The page shows a spinner and "Signing you in with Google..." and sends GET /api/v1/auth/google/callback with code and state as query parameters. The call runs once.
  4. On success the same three values are stored as for password sign-in, the same role check runs, and the app navigates immediately (replacing the history entry): agents who are not KYC verified to /onboarding, lawyers to /legal, everyone else to /.
ProblemWhat the user sees
No code in the callback URLToast "Google sign-in failed. No authorization code received.", then /auth/signin
The callback request failsToast with the API message, or "Google sign-in failed.", then /auth/signin
Role not allowedThe redirect-to-consumer-app toast described above

Google sign-in shows no "Welcome back!" toast and ignores the saved callback URL.

Forgot password

  1. Open /auth/forgot-password ("Forgot Password?" on the sign-in password step). The copy reads "Enter your email address and we'll send you a link to reset your password."
  2. Enter Email Address. The field is a browser email input marked required; Send Reset Link is disabled while it is empty. There is no other client-side validation.
  3. Submitting sends POST /api/v1/auth/forgot-password with email.
  4. On success the form is replaced by a confirmation: "We've sent a password reset link to" followed by the email, and three notes (check inbox and spam, click the link, "The link will expire in 24 hours").
  5. Didn't receive email? Resend sends the same request again. Success toast: "Reset link resent. Please check your inbox." Failure toast: the API message, or "Failed to resend. Please try again."
  6. Back to Sign In returns to /auth/signin.

A failed first request shows the API message, or "Failed to send reset link. Please try again."

Reset password

The link in the email opens /auth/reset-password?token=.... The heading is "Create New Password".

  1. Enter New Password and Confirm Password. Both have show/hide buttons.

    RuleEffect
    New password under 8 charactersReset Password stays disabled
    Passwords differ"Passwords do not match" under the confirm field; button stays disabled

    A strength label and bar follow length only: "WEAK" under 8 characters, "MODERATE" for 8 to 11, "STRONG" for 12 or more.

  2. Press Reset Password. The app sends POST /api/v1/auth/reset-password with token and password.

  3. On success the heading changes to "Password Reset" with "Your password has been successfully reset. You can now sign in with your new password." Sign In goes to /auth/signin. The user is not signed in automatically.

  4. On failure a toast shows the API message, or "Failed to reset password. Please try again."

The requirements box is advisory

The blue "Password Requirements" box lists "At least 8 characters", "Mix of letters, numbers and symbols" and "Different from your previous passwords". The client only enforces the length; anything stricter comes back from the API as an error toast.

Sign out

There are three ways to sign out, and they do not behave the same.

Entry pointWhat it does
Topbar profile menu, LogoutSends POST /api/v1/auth/signout with the stored refreshToken. On success removes token, refreshToken and user and clears the Redux user. Then navigates to /auth/signin.
Global search, Log outSame as the profile menu.
Sidebar, LogoutA plain link to /auth/signin. No request is sent and nothing is removed from storage.

The sidebar Logout does not end the session

After clicking Logout in the sidebar the token is still in sessionStorage, so typing / in the address bar opens the dashboard again. Use the profile menu to sign out properly. Also note that if the sign-out request itself fails, storage is not cleared but the app still shows the sign-in page.

States and edge cases

  • Missing reset token. Submitting the reset form without ?token= in the URL shows "Reset token is missing. Please use the link from your email." and sends nothing.
  • Expired session. When an Axios request gets a 401 with the message Token has Expired, the app saves the current path to hl_callback_url, clears the session and hard-redirects to /auth/signin. The next password sign-in returns the user to that path. Details are in the section overview.
  • New tab. The access token is per tab (sessionStorage), so a new tab always starts at /auth/signin.
  • Already signed in. The auth pages do not redirect a signed-in user. Signing in again simply overwrites the stored values.
  • Google button while loading. It is disabled while any auth request is in flight.

What happens next

  • Unverified agents continue to Onboarding and KYC.
  • Agents and landlords land in the app shell on the dashboard home.
  • The reset email itself is sent by the API after POST /api/v1/auth/forgot-password; the client only shows the confirmation.

On this page