Actions#
The @veap/auth/actions entry point exports signIn, signUp, finalizeLogin and signOut.
signIn(data: LoginInput)resolvesAuthService, runs sign-in, and returns a result.signUp(data: RegisterInput)resolvesAuthService, runs registration, and returns a result.finalizeLogin(userId, flags)finalizes the session after any additional challenge flow.signOut()ends the active session and returns a result.
These are Next.js Server Actions ("use server"). Call them from a compatible Next.js server/client action boundary; do not import them into a generic browser bundle as ordinary functions.
Input types#
The validation subpath exports LoginInput, RegisterInput, ForgotPasswordInput, ResetPasswordInput, and VerifyEmailInput inferred from Zod schemas. Validate untrusted input on the server even if a client form uses the same schema.
Response handling#
AuthResponse has three top-level statuses: SUCCESS, CHALLENGE_REQUIRED, and ERROR. A challenge-required response is not a failed password check; the UI should route the user through the required second step without creating a fully authenticated session prematurely.