@seamless-auth/express 0.0.2-beta.15 → 0.0.2-beta.17
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 +10 -1
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ type SeamlessAuthServerOptions = {
|
|
|
13
13
|
refreshCookieName?: string;
|
|
14
14
|
preAuthCookieName?: string;
|
|
15
15
|
};
|
|
16
|
+
interface SeamlessAuthUser {
|
|
17
|
+
id: string;
|
|
18
|
+
sub: string;
|
|
19
|
+
roles: string[];
|
|
20
|
+
email: string;
|
|
21
|
+
phone: string;
|
|
22
|
+
iat?: number;
|
|
23
|
+
exp?: number;
|
|
24
|
+
}
|
|
16
25
|
/**
|
|
17
26
|
* Creates an Express Router that proxies all authentication traffic to a Seamless Auth server.
|
|
18
27
|
*
|
|
@@ -185,4 +194,4 @@ declare function createEnsureCookiesMiddleware(opts: EnsureCookiesMiddlewareOpti
|
|
|
185
194
|
|
|
186
195
|
declare function getSeamlessUser(req: Request, opts: SeamlessAuthServerOptions): Promise<any>;
|
|
187
196
|
|
|
188
|
-
export { type SeamlessAuthServerOptions, createEnsureCookiesMiddleware, createSeamlessAuthServer as default, getSeamlessUser, requireAuth, requireRole };
|
|
197
|
+
export { type SeamlessAuthServerOptions, type SeamlessAuthUser, createEnsureCookiesMiddleware, createSeamlessAuthServer as default, getSeamlessUser, requireAuth, requireRole };
|
package/dist/index.js
CHANGED
|
@@ -433,7 +433,9 @@ function requireAuth(opts) {
|
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
435
|
const user = {
|
|
436
|
+
id: payload.sub,
|
|
436
437
|
sub: payload.sub,
|
|
438
|
+
// TODO: Silly to store the same value twice. Search every where its used and phase this out.
|
|
437
439
|
roles: Array.isArray(payload.roles) ? payload.roles : [],
|
|
438
440
|
email: payload.email,
|
|
439
441
|
phone: payload.phone,
|