@openstax/ts-utils 1.1.29 → 1.1.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.
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.decryptionAuthProvider = void 0;
|
|
4
4
|
const jose_1 = require("jose");
|
|
5
5
|
const __1 = require("../..");
|
|
6
|
-
const
|
|
6
|
+
const resolveConfigValue_1 = require("../../config/resolveConfigValue");
|
|
7
7
|
const guards_1 = require("../../guards");
|
|
8
8
|
const _1 = require(".");
|
|
9
9
|
const decryptionAuthProvider = (initializer) => (configProvider) => {
|
|
10
10
|
const config = configProvider[(0, guards_1.ifDefined)(initializer.configSpace, 'decryption')];
|
|
11
|
-
const cookieName = (0, __1.once)(() => (0,
|
|
12
|
-
const encryptionPrivateKey = (0, __1.once)(() => (0,
|
|
13
|
-
const signaturePublicKey = (0, __1.once)(() => (0,
|
|
11
|
+
const cookieName = (0, __1.once)(() => (0, resolveConfigValue_1.resolveConfigValue)(config.cookieName));
|
|
12
|
+
const encryptionPrivateKey = (0, __1.once)(() => (0, resolveConfigValue_1.resolveConfigValue)(config.encryptionPrivateKey));
|
|
13
|
+
const signaturePublicKey = (0, __1.once)(() => (0, resolveConfigValue_1.resolveConfigValue)(config.signaturePublicKey));
|
|
14
14
|
const decryptAndVerify = async (jwt) => {
|
|
15
15
|
try {
|
|
16
16
|
// Decrypt SSO cookie
|