Skip to content

PRD: Authentication & account verification

ModuleUser ManagementPRD IDPRD-AUTH-001
StatusReady to devFEATAUTH
EpicPlaneBANA-1526
Date2026-05-25Versionv1.0
Packages@nx/identityURDAUTH
SurfaceClient · Owner/MgrSale · POSBO · Ops
OwnerPhát Nguyễn

What Authentication & account verification is

User Management is the platform's foundation - every other module trusts the identity and scope it issues. Sign-up and password sign-in already work; this PRD closes the three gaps that remain on top of that foundation: verifying identity before getting to work, setting a first password for an account created on someone's behalf, and blocking sign-in across Client, Sale, and Back Office.

Three gaps closed

Before this increment, a fresh account had not yet proven it owns a phone number or email before the user started using the app. A Client user who forgot their password could self-serve, but an employee whose account was created on their behalf, on Back Office, had no way to set a first password. And Client, Sale, and Back Office serve three very different audiences, but nothing stopped an administrative account from signing into the customer-facing page, or the reverse.

This increment closes all three gaps on top of the existing sign-up / sign-in / password-hashing foundation: an onboarding wizard that treats phone verification as a hard gate, a dedicated route for an owner or manager to set a password for an account created on someone's behalf, and cross-page sign-in blocking by role tier - all enforced on the server, not just in the interface.

One account, from sign-up to first use

StepWhat happens
1. Sign-upOn Client, enter first name, last name, username, password, tick terms acceptance → account, profile, the username identifier, and default settings are created together, and the user lands in the app right away
2. OnboardingA 4-step wizard follows: phone verification (hard gate) → business creation → plan selection → welcome
3. Daily sign-inThe same identifier field (username, or a verified email/phone) plus a password field, shared across Client, Sale, and Back Office
4. Forgot passwordOn Client, self-serve a reset through exactly one recovery channel (an email carrying both a 6-digit code and a link, or an SMS OTP)
5. Employee created on your behalfAn owner or manager sends a dedicated link so the employee can set their first password themselves

Where it's easy to get wrong

Blocking by role tier lives on the server, not the interface

An account with a system role above Owner (Super Admin, Admin, Operator) cannot sign in on Client or Sale; an account at Owner tier and below cannot sign in on Back Office.

Refusing to issue a token happens right at the server. Calling the API directly is blocked too, not just a hidden button in the interface.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.