ras-stack 0.45.0 → 0.45.1
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/auth/settings.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare function standardSessionOptions<const Options extends object>(ove
|
|
|
13
13
|
expiresIn: number;
|
|
14
14
|
updateAge: number;
|
|
15
15
|
};
|
|
16
|
-
export declare function standardAccountOptions<
|
|
16
|
+
export declare function standardAccountOptions<Options extends object>(overrides?: Options & StandardAccountOptions): Options & {
|
|
17
17
|
encryptOAuthTokens: boolean;
|
|
18
18
|
};
|
|
19
19
|
export declare function standardRateLimitOptions(customRules?: Record<string, RateLimitRule>): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/auth/settings.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,sBAAsB,CAA+B,SAAS,GAA6B,EAA8B;IACvI,OAAO;QACL,GAAG,SAAS;QACZ,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;QACnD,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE;KAC/C,CAAA;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,SAAS,GAAqC,EAAsC;IAEpF,OAAO;QACL,GAAG,SAAS;QACZ,kBAAkB,EAAE,SAAS,CAAC,kBAAkB,IAAI,IAAI;KACzD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,WAAW,GAAkC,EAAE;IACtF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,UAAmB;QAC5B,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,GAAG;QACR,WAAW,EAAE;YACX,gBAAgB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACzC,gBAAgB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACzC,yBAAyB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;YACjD,0BAA0B,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACnD,GAAG,WAAW;SACf;KACF,CAAA;AACH,CAAC","sourcesContent":["export type RateLimitRule = { window: number; max: number }\n\nexport type SessionOptions = { expiresIn?: number | undefined; updateAge?: number | undefined }\nexport type StandardAccountOptions = { encryptOAuthTokens?: boolean }\n\nexport function standardSessionOptions<const Options extends object>(overrides: Options & SessionOptions = {} as Options & SessionOptions) {\n return {\n ...overrides,\n expiresIn: overrides.expiresIn ?? 60 * 60 * 24 * 90,\n updateAge: overrides.updateAge ?? 60 * 60 * 24,\n }\n}\n\nexport function standardAccountOptions<
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/auth/settings.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,sBAAsB,CAA+B,SAAS,GAA6B,EAA8B;IACvI,OAAO;QACL,GAAG,SAAS;QACZ,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;QACnD,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE;KAC/C,CAAA;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,SAAS,GAAqC,EAAsC;IAEpF,OAAO;QACL,GAAG,SAAS;QACZ,kBAAkB,EAAE,SAAS,CAAC,kBAAkB,IAAI,IAAI;KACzD,CAAA;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,WAAW,GAAkC,EAAE;IACtF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,UAAmB;QAC5B,MAAM,EAAE,EAAE;QACV,GAAG,EAAE,GAAG;QACR,WAAW,EAAE;YACX,gBAAgB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACzC,gBAAgB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACzC,yBAAyB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE;YACjD,0BAA0B,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACnD,GAAG,WAAW;SACf;KACF,CAAA;AACH,CAAC","sourcesContent":["export type RateLimitRule = { window: number; max: number }\n\nexport type SessionOptions = { expiresIn?: number | undefined; updateAge?: number | undefined }\nexport type StandardAccountOptions = { encryptOAuthTokens?: boolean }\n\nexport function standardSessionOptions<const Options extends object>(overrides: Options & SessionOptions = {} as Options & SessionOptions) {\n return {\n ...overrides,\n expiresIn: overrides.expiresIn ?? 60 * 60 * 24 * 90,\n updateAge: overrides.updateAge ?? 60 * 60 * 24,\n }\n}\n\nexport function standardAccountOptions<Options extends object>(\n overrides: Options & StandardAccountOptions = {} as Options & StandardAccountOptions,\n) {\n return {\n ...overrides,\n encryptOAuthTokens: overrides.encryptOAuthTokens ?? true,\n }\n}\n\nexport function standardRateLimitOptions(customRules: Record<string, RateLimitRule> = {}) {\n return {\n enabled: true,\n storage: 'database' as const,\n window: 60,\n max: 120,\n customRules: {\n '/sign-in/email': { window: 60, max: 20 },\n '/sign-up/email': { window: 60, max: 15 },\n '/request-password-reset': { window: 60, max: 5 },\n '/admin/set-user-password': { window: 60, max: 10 },\n ...customRules,\n },\n }\n}\n"]}
|