@baseworks/auth 0.2.5 → 0.2.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.
package/dist/hono.d.ts CHANGED
@@ -5,6 +5,7 @@ interface ServiceAuthUser {
5
5
  userId: string;
6
6
  orgId?: string;
7
7
  role?: string;
8
+ email?: string;
8
9
  tokenType: 'user' | 'service';
9
10
  }
10
11
  declare module 'hono' {
package/dist/hono.js CHANGED
@@ -15,6 +15,7 @@ async function requireAuth(c, next) {
15
15
  userId: String(claims["sub"] ?? ""),
16
16
  orgId: claims["org_id"],
17
17
  role: claims["role"],
18
+ email: claims["email"],
18
19
  tokenType: claims["type"] === "service" ? "service" : "user"
19
20
  });
20
21
  return next();
package/dist/jwt.d.ts CHANGED
@@ -6,6 +6,7 @@ interface JwtClaims {
6
6
  iat?: number;
7
7
  org_id?: string;
8
8
  role?: string;
9
+ email?: string;
9
10
  type?: string;
10
11
  [key: string]: unknown;
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baseworks/auth",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
package/src/hono.ts CHANGED
@@ -5,6 +5,7 @@ export interface ServiceAuthUser {
5
5
  userId: string
6
6
  orgId?: string
7
7
  role?: string
8
+ email?: string
8
9
  tokenType: 'user' | 'service'
9
10
  }
10
11
 
@@ -34,6 +35,7 @@ export async function requireAuth(c: Context, next: Next) {
34
35
  userId: String(claims['sub'] ?? ''),
35
36
  orgId: claims['org_id'] as string | undefined,
36
37
  role: claims['role'] as string | undefined,
38
+ email: claims['email'] as string | undefined,
37
39
  tokenType: claims['type'] === 'service' ? 'service' : 'user',
38
40
  })
39
41
  return next()
package/src/jwt.ts CHANGED
@@ -18,6 +18,7 @@ export interface JwtClaims {
18
18
  iat?: number
19
19
  org_id?: string
20
20
  role?: string
21
+ email?: string
21
22
  type?: string
22
23
  [key: string]: unknown
23
24
  }