@veap/auth 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +10 -4
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -82,9 +82,10 @@ import { AuthServiceProvider } from "@veap/auth";
82
82
  export const app = Application.configure()
83
83
  .use(DatabaseServiceProvider)
84
84
  .use(
85
- new AuthServiceProvider(undefined, {
86
- autoMigrate: true, // Automatically applies auth tables on boot
87
- }),
85
+ (c) =>
86
+ new AuthServiceProvider(c, {
87
+ autoMigrate: true, // Automatically applies auth tables on boot
88
+ }),
88
89
  )
89
90
  .create();
90
91
  ```
@@ -108,6 +109,10 @@ export async function handleLogin(formData: FormData) {
108
109
  return { error: result.error?.message || "Invalid credentials" };
109
110
  }
110
111
 
112
+ if (result.data.status === "CHALLENGE_REQUIRED") {
113
+ return { challenge: result.data };
114
+ }
115
+
111
116
  return { user: result.data.user };
112
117
  }
113
118
 
@@ -131,7 +136,7 @@ import { hashPassword } from "@veap/auth/server";
131
136
 
132
137
  // Create a new user with hashed credentials
133
138
  const user = await User.create({
134
- name: "Jane Doe",
139
+ username: "janedoe",
135
140
  email: "jane@example.com",
136
141
  password: await hashPassword("securePassword123"),
137
142
  recovery_code: Buffer.from("recovery-key-bytes"),
@@ -154,6 +159,7 @@ if (adminRole) {
154
159
  | `@veap/auth/actions` | Next.js Server Actions directly exportable for actions boundaries |
155
160
  | `@veap/auth/models` | Active Record models (`User`, `Session`, `Role`, `Permission`) |
156
161
  | `@veap/auth/migrations` | Knex migrations for authentication tables |
162
+ | `@veap/auth/validation` | Zod validation schemas (`loginSchema`, `registerSchema`, and others) |
157
163
 
158
164
  ## Documentation
159
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veap/auth",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Authentication, session management, RBAC, and crypto adapters for Veap",
5
5
  "bugs": "https://github.com/veapjs/veap-auth/issues",
6
6
  "repository": {
@@ -55,9 +55,9 @@
55
55
  "@oslojs/binary": "^1.0.0",
56
56
  "@oslojs/crypto": "^1.0.1",
57
57
  "@oslojs/encoding": "^1.1.0",
58
- "@veap/database": "0.1.6",
59
- "@veap/kernel": "0.1.6",
60
- "@veap/mail": "0.1.6",
58
+ "@veap/database": "0.1.7",
59
+ "@veap/kernel": "0.2.0",
60
+ "@veap/mail": "0.1.7",
61
61
  "bcryptjs": "^3.0.3",
62
62
  "date-fns": "^4.4.0",
63
63
  "zod": "^3.24.2"