@denodeio/seshat 0.0.29 → 0.0.30
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/build/cjs/dist/mjs/src/index.d.ts +1 -0
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +4 -4
- package/build/cjs/index.js.map +1 -1
- package/build/mjs/dist/mjs/src/index.d.ts +1 -0
- package/build/mjs/index.d.ts +1 -0
- package/build/mjs/index.js +4 -4
- package/build/mjs/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ export * from "./signer";
|
|
|
28
28
|
type OptionsInput = {
|
|
29
29
|
fieldName?: string;
|
|
30
30
|
barongJwtPublicKey?: string;
|
|
31
|
+
jwtPublicKey?: string;
|
|
31
32
|
issuer?: string;
|
|
32
33
|
};
|
|
33
34
|
export declare const sessionVerifier: (options: OptionsInput) => (req: any, res: any, next: any) => void;
|
package/build/cjs/index.d.ts
CHANGED
package/build/cjs/index.js
CHANGED
|
@@ -6545,10 +6545,10 @@ signer.signData = signData;
|
|
|
6545
6545
|
__exportStar(signer, exports);
|
|
6546
6546
|
const sessionVerifier = function (options) {
|
|
6547
6547
|
const { fieldName = "session", ...actualOptions } = options;
|
|
6548
|
-
if (!options || !options.barongJwtPublicKey) {
|
|
6549
|
-
throw new Error("
|
|
6548
|
+
if (!options || (!options.barongJwtPublicKey && !options.jwtPublicKey)) {
|
|
6549
|
+
throw new Error("JWT Public key should be set");
|
|
6550
6550
|
}
|
|
6551
|
-
const
|
|
6551
|
+
const jwtPublicKey = options.barongJwtPublicKey || options.jwtPublicKey;
|
|
6552
6552
|
const defaultOptions = {
|
|
6553
6553
|
algorithms: ["RS256"],
|
|
6554
6554
|
issuer: "auth"
|
|
@@ -6565,7 +6565,7 @@ signer.signData = signData;
|
|
|
6565
6565
|
return;
|
|
6566
6566
|
}
|
|
6567
6567
|
try {
|
|
6568
|
-
req[fieldName] = jsonwebtoken_1.default.verify(authHeader,
|
|
6568
|
+
req[fieldName] = jsonwebtoken_1.default.verify(authHeader, jwtPublicKey, verificationOptions);
|
|
6569
6569
|
}
|
|
6570
6570
|
catch (error) {
|
|
6571
6571
|
res.status(403);
|