mirror of
https://github.com/tiennm99/bsk.git
synced 2026-08-27 10:27:25 +00:00
- 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.