@seamless-auth/express 0.0.2-beta.14 → 0.0.2-beta.16

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/index.d.ts CHANGED
@@ -5,6 +5,7 @@ type SeamlessAuthServerOptions = {
5
5
  cookieSecret: string;
6
6
  serviceSecret: string;
7
7
  issuer: string;
8
+ audience: string;
8
9
  jwksKid?: string;
9
10
  cookieDomain?: string;
10
11
  accessCookieName?: string;
@@ -12,6 +13,14 @@ type SeamlessAuthServerOptions = {
12
13
  refreshCookieName?: string;
13
14
  preAuthCookieName?: string;
14
15
  };
16
+ interface SeamlessAuthUser {
17
+ sub: string;
18
+ roles: string[];
19
+ email: string;
20
+ phone: string;
21
+ iat?: number;
22
+ exp?: number;
23
+ }
15
24
  /**
16
25
  * Creates an Express Router that proxies all authentication traffic to a Seamless Auth server.
17
26
  *
@@ -184,4 +193,4 @@ declare function createEnsureCookiesMiddleware(opts: EnsureCookiesMiddlewareOpti
184
193
 
185
194
  declare function getSeamlessUser(req: Request, opts: SeamlessAuthServerOptions): Promise<any>;
186
195
 
187
- export { type SeamlessAuthServerOptions, createEnsureCookiesMiddleware, createSeamlessAuthServer as default, getSeamlessUser, requireAuth, requireRole };
196
+ export { type SeamlessAuthServerOptions, type SeamlessAuthUser, createEnsureCookiesMiddleware, createSeamlessAuthServer as default, getSeamlessUser, requireAuth, requireRole };
package/dist/index.js CHANGED
@@ -145,7 +145,7 @@ function buildServiceAuthorization(req, opts) {
145
145
  const token = createServiceToken({
146
146
  subject: req.cookiePayload?.sub || req.user.sub,
147
147
  issuer: opts.issuer,
148
- audience: opts.authServerUrl,
148
+ audience: opts.audience,
149
149
  serviceSecret: opts.serviceSecret,
150
150
  keyId: opts.jwksKid
151
151
  });
@@ -316,6 +316,7 @@ function createSeamlessAuthServer(opts) {
316
316
  const resolvedOpts = {
317
317
  authServerUrl: opts.authServerUrl,
318
318
  issuer: opts.issuer,
319
+ audience: opts.audience,
319
320
  cookieSecret: opts.cookieSecret,
320
321
  serviceSecret: opts.serviceSecret,
321
322
  jwksKid: opts.jwksKid ?? "dev-main",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamless-auth/express",
3
- "version": "0.0.2-beta.14",
3
+ "version": "0.0.2-beta.16",
4
4
  "description": "Express adapter for Seamless Auth passwordless authentication",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",