@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/mjs/index.d.ts
CHANGED
package/build/mjs/index.js
CHANGED
|
@@ -6509,10 +6509,10 @@ function signData(payload, options) {
|
|
|
6509
6509
|
|
|
6510
6510
|
const sessionVerifier = function (options) {
|
|
6511
6511
|
const { fieldName = "session", ...actualOptions } = options;
|
|
6512
|
-
if (!options || !options.barongJwtPublicKey) {
|
|
6513
|
-
throw new Error("
|
|
6512
|
+
if (!options || (!options.barongJwtPublicKey && !options.jwtPublicKey)) {
|
|
6513
|
+
throw new Error("JWT Public key should be set");
|
|
6514
6514
|
}
|
|
6515
|
-
const
|
|
6515
|
+
const jwtPublicKey = options.barongJwtPublicKey || options.jwtPublicKey;
|
|
6516
6516
|
const defaultOptions = {
|
|
6517
6517
|
algorithms: ["RS256"],
|
|
6518
6518
|
issuer: "auth"
|
|
@@ -6529,7 +6529,7 @@ const sessionVerifier = function (options) {
|
|
|
6529
6529
|
return;
|
|
6530
6530
|
}
|
|
6531
6531
|
try {
|
|
6532
|
-
req[fieldName] = jwt.verify(authHeader,
|
|
6532
|
+
req[fieldName] = jwt.verify(authHeader, jwtPublicKey, verificationOptions);
|
|
6533
6533
|
}
|
|
6534
6534
|
catch (error) {
|
|
6535
6535
|
res.status(403);
|