@autonoma-ai/server-express 0.1.3 → 0.1.4

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 +8 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -26,7 +26,7 @@ app.post('/api/autonoma', createExpressHandler({
26
26
  signingSecret: process.env.AUTONOMA_SIGNING_SECRET!,
27
27
  auth: async (user) => {
28
28
  const session = await createSession(user.id as string)
29
- return { token: session.token }
29
+ return { headers: { Authorization: `Bearer ${session.token}` } }
30
30
  },
31
31
  }))
32
32
  ```
@@ -49,7 +49,7 @@ app.post('/api/autonoma', async (req, reply) => {
49
49
 
50
50
  ## Auth callback
51
51
 
52
- The `auth` callback receives the first `User` created during setup and must return real credentials that the test runner can use to log in:
52
+ The `auth` callback receives the first `User` record created during setup (or `null` if no User model exists) and must return credentials for the test runner to authenticate:
53
53
 
54
54
  ```typescript
55
55
  // Session cookie
@@ -63,7 +63,12 @@ auth: async (user) => {
63
63
  // Bearer token
64
64
  auth: async (user) => {
65
65
  const token = jwt.sign({ sub: user.id }, SECRET)
66
- return { token }
66
+ return { headers: { Authorization: `Bearer ${token}` } }
67
+ }
68
+
69
+ // Username + password (for login-page flows)
70
+ auth: async (user) => {
71
+ return { credentials: { email: user.email as string, password: 'TestP@ssw0rd123!' } }
67
72
  }
68
73
  ```
69
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autonoma-ai/server-express",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Express/Fastify server adapter for Autonoma SDK",
5
5
  "type": "module",
6
6
  "exports": {
@@ -16,7 +16,7 @@
16
16
  "access": "public"
17
17
  },
18
18
  "dependencies": {
19
- "@autonoma-ai/sdk": "0.1.3"
19
+ "@autonoma-ai/sdk": "0.1.4"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/node": "^22.0.0",