@omni-co/embed 0.3.0-pre.3 → 0.3.0
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/lib/cjs/signature.js +3 -1
- package/lib/esm/signature.js +3 -1
- package/package.json +2 -1
package/lib/cjs/signature.js
CHANGED
|
@@ -5,10 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TEST_ONLY = exports.getSignature = exports.hmacSign = void 0;
|
|
7
7
|
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
+
const base64url_1 = __importDefault(require("base64url"));
|
|
8
9
|
const hmacSign = (data, secret) => {
|
|
9
10
|
const hmac = crypto_1.default.createHmac("sha256", secret);
|
|
10
11
|
hmac.update(data);
|
|
11
|
-
|
|
12
|
+
const b64 = hmac.digest("base64");
|
|
13
|
+
return base64url_1.default.fromBase64(b64);
|
|
12
14
|
};
|
|
13
15
|
exports.hmacSign = hmacSign;
|
|
14
16
|
const generateStringForSignature = ({ loginUrl, contentPath, externalId, name, nonce, userAttributes, entity, prefersDark, theme, }) => {
|
package/lib/esm/signature.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import crypto from "crypto";
|
|
2
|
+
import base64url from "base64url";
|
|
2
3
|
export const hmacSign = (data, secret) => {
|
|
3
4
|
const hmac = crypto.createHmac("sha256", secret);
|
|
4
5
|
hmac.update(data);
|
|
5
|
-
|
|
6
|
+
const b64 = hmac.digest("base64");
|
|
7
|
+
return base64url.fromBase64(b64);
|
|
6
8
|
};
|
|
7
9
|
const generateStringForSignature = ({ loginUrl, contentPath, externalId, name, nonce, userAttributes, entity, prefersDark, theme, }) => {
|
|
8
10
|
const optionalParams = [];
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.3.0
|
|
2
|
+
"version": "0.3.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "@omni-co/embed",
|
|
5
5
|
"author": "Nate Agrin <nate@exploreomni.com>",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"test:watch": "vitest --watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"base64url": "^3.0.1",
|
|
22
23
|
"nanoid": "^5.0.2"
|
|
23
24
|
},
|
|
24
25
|
"engines": {
|