Files
bsk/lib
tiennm99 e514d710c4 feat(phase-1): sign-in/sign-out server actions + zod schema
- lib/auth/schemas.ts: SignInSchema (Zod v4, email + password 8-72),
  SignInState discriminated union (idle | error), parseSignIn helper.
  Framework-agnostic — no 'use server' so client RHF resolver can import.
- app/[locale]/(auth)/sign-in/actions.ts: signInAction (RHF/useActionState
  shape) + signOutAction. Flow: safeParse → signInWithPassword → enrollment
  check via bsk.app_users → redirect to /[locale]/dashboard. Wrong-password
  and unenrolled paths return the SAME generic error (auth.users
  enumeration defense). redirect() called outside try/catch per
  React 19 / Next 16 semantics.
- messages/{vi,en}.json: auth.signIn.* keys in parity.

Scope honored: no rate limit, no next= guard, no IP extraction.
2026-05-25 17:36:09 +07:00
..