@replyke/core 5.0.0-beta.32 → 5.0.0-beta.35
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/cjs/config/useAxiosPrivate.js +1 -1
- package/dist/cjs/config/useAxiosPrivate.js.map +1 -1
- package/dist/cjs/hooks/crypto/useSignTestingJwt.js +8 -11
- package/dist/cjs/hooks/crypto/useSignTestingJwt.js.map +1 -1
- package/dist/esm/config/useAxiosPrivate.js +1 -1
- package/dist/esm/config/useAxiosPrivate.js.map +1 -1
- package/dist/esm/hooks/crypto/useSignTestingJwt.js +8 -11
- package/dist/esm/hooks/crypto/useSignTestingJwt.js.map +1 -1
- package/package.json +2 -1
|
@@ -48,7 +48,7 @@ var useAxiosPrivate = function () {
|
|
|
48
48
|
(0, react_1.useEffect)(function () {
|
|
49
49
|
var requestIntercept = axios_1.axiosPrivate.interceptors.request.use(function (config) {
|
|
50
50
|
// If we have no value for access token return the config as is
|
|
51
|
-
// This is a new addition so maybe let's avoid it for not until
|
|
51
|
+
// This is a new addition so maybe let's avoid it for not until everything works fine.
|
|
52
52
|
// if (!accessToken) return config;
|
|
53
53
|
// If we already have Auth headers set then just return the config
|
|
54
54
|
if (config.headers["Authorization"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAxiosPrivate.js","sourceRoot":"","sources":["../../../src/config/useAxiosPrivate.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+BAAkC;AAClC,iCAAuC;AACvC,kEAA4C;AAE5C,IAAM,eAAe,GAAG;IAChB,IAAA,KAAyC,IAAA,iBAAO,GAAE,EAAhD,WAAW,iBAAA,EAAE,qBAAqB,2BAAc,CAAC;IAEzD,IAAA,iBAAS,EAAC;QACR,IAAM,gBAAgB,GAAG,oBAAY,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAC5D,UAAC,MAAM;YACL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I,CAAC;wBACD,qBAAM,CAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,EAAI,CAAA,EAAA;;wBAAhD,cAAc,GAAG,SAA+B;wBACtD,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,iBAAU,cAAc,CAAE,CAAC;wBAClE,sBAAO,IAAA,oBAAY,EAAC,WAAW,CAAC,EAAC;4BAEnC,sBAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC;;;aAC9B,CACF,CAAC;QAEF,OAAO;YACL,oBAAY,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC1D,oBAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC9D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAEzC,OAAO,oBAAY,CAAC;AACtB,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -39,35 +39,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
var
|
|
42
|
+
var axios_1 = __importDefault(require("axios"));
|
|
43
43
|
var handleError_1 = require("../../utils/handleError");
|
|
44
44
|
function useSignTestingJwt() {
|
|
45
45
|
var _this = this;
|
|
46
46
|
var signTestingJwt = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
47
|
-
var
|
|
47
|
+
var response, err_1;
|
|
48
48
|
var projectId = _b.projectId, privateKey = _b.privateKey, payload = _b.payload;
|
|
49
49
|
return __generator(this, function (_c) {
|
|
50
50
|
switch (_c.label) {
|
|
51
51
|
case 0:
|
|
52
|
-
|
|
53
|
-
_c.label = 1;
|
|
54
|
-
case 1:
|
|
55
|
-
_c.trys.push([1, 3, , 4]);
|
|
52
|
+
_c.trys.push([0, 2, , 3]);
|
|
56
53
|
// Warn developers about the security risks
|
|
57
54
|
console.warn("\n WARNING: You are using a testing function to generate JWTs in your client application.\n This is NOT secure and should ONLY be used for initial development and testing purposes.\n\n In production:\n - NEVER expose your secret key in client-side code.\n - Refer to the documentation at https://docs.replyke.com to implement JWT signing on your backend.\n - Rotate your secret key periodically, especially after moving from testing to production.\n\n Failure to follow these practices can lead to security vulnerabilities.\n ");
|
|
58
|
-
return [4 /*yield*/,
|
|
55
|
+
return [4 /*yield*/, axios_1.default.post("https://api.replyke.com/internal/crypto/sign-testing-jwt", {
|
|
59
56
|
projectId: projectId,
|
|
60
57
|
privateKey: privateKey,
|
|
61
58
|
payload: payload,
|
|
62
59
|
})];
|
|
63
|
-
case
|
|
60
|
+
case 1:
|
|
64
61
|
response = _c.sent();
|
|
65
62
|
return [2 /*return*/, response.data];
|
|
66
|
-
case
|
|
63
|
+
case 2:
|
|
67
64
|
err_1 = _c.sent();
|
|
68
65
|
(0, handleError_1.handleError)(err_1, "Failed to sign testing jwt: ");
|
|
69
|
-
return [3 /*break*/,
|
|
70
|
-
case
|
|
66
|
+
return [3 /*break*/, 3];
|
|
67
|
+
case 3: return [2 /*return*/];
|
|
71
68
|
}
|
|
72
69
|
});
|
|
73
70
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,uDAAsD;AAEtD,SAAS,iBAAiB;IAA1B,iBAwCC;IAvCC,IAAM,cAAc,GAAG,gEAAO,EAQ7B;;YAPC,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,OAAO,aAAA;;;;;oBAOL,2CAA2C;oBAC3C,OAAO,CAAC,IAAI,CAAC,siBAUhB,CAAC,CAAC;oBAEkB,qBAAM,eAAK,CAAC,IAAI,CAC/B,0DAA0D,EAC1D;4BACE,SAAS,WAAA;4BACT,UAAU,YAAA;4BACV,OAAO,SAAA;yBACR,CACF,EAAA;;oBAPK,QAAQ,GAAG,SAOhB;oBAED,sBAAO,QAAQ,CAAC,IAAc,EAAC;;;oBAE/B,IAAA,yBAAW,EAAC,KAAG,EAAE,8BAA8B,CAAC,CAAC;;;;;SAEpD,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,kBAAe,iBAAiB,CAAC"}
|
|
@@ -43,7 +43,7 @@ var useAxiosPrivate = function () {
|
|
|
43
43
|
useEffect(function () {
|
|
44
44
|
var requestIntercept = axiosPrivate.interceptors.request.use(function (config) {
|
|
45
45
|
// If we have no value for access token return the config as is
|
|
46
|
-
// This is a new addition so maybe let's avoid it for not until
|
|
46
|
+
// This is a new addition so maybe let's avoid it for not until everything works fine.
|
|
47
47
|
// if (!accessToken) return config;
|
|
48
48
|
// If we already have Auth headers set then just return the config
|
|
49
49
|
if (config.headers["Authorization"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAxiosPrivate.js","sourceRoot":"","sources":["../../../src/config/useAxiosPrivate.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAE5C,IAAM,eAAe,GAAG;IAChB,IAAA,KAAyC,OAAO,EAAE,EAAhD,WAAW,iBAAA,EAAE,qBAAqB,2BAAc,CAAC;IAEzD,SAA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,KAAK,CAAE,QAAQ,0CAAE,MAAM,MAAK,GAAG,IAAI,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,CAAA,CAAA,EAArD,wBAAqD;wBACvD,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;wBACD,qBAAM,CAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,EAAI,CAAA,EAAA;;wBAAhD,cAAc,GAAG,SAA+B;wBACtD,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,iBAAU,cAAc,CAAE,CAAC;wBAClE,sBAAO,YAAY,CAAC,WAAW,CAAC,EAAC;4BAEnC,sBAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC;;;aAC9B,CACF,CAAC;QAEF,OAAO;YACL,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC1D,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC9D,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAEzC,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -34,35 +34,32 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import
|
|
37
|
+
import axios from "axios";
|
|
38
38
|
import { handleError } from "../../utils/handleError";
|
|
39
39
|
function useSignTestingJwt() {
|
|
40
40
|
var _this = this;
|
|
41
41
|
var signTestingJwt = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
42
|
-
var
|
|
42
|
+
var response, err_1;
|
|
43
43
|
var projectId = _b.projectId, privateKey = _b.privateKey, payload = _b.payload;
|
|
44
44
|
return __generator(this, function (_c) {
|
|
45
45
|
switch (_c.label) {
|
|
46
46
|
case 0:
|
|
47
|
-
|
|
48
|
-
_c.label = 1;
|
|
49
|
-
case 1:
|
|
50
|
-
_c.trys.push([1, 3, , 4]);
|
|
47
|
+
_c.trys.push([0, 2, , 3]);
|
|
51
48
|
// Warn developers about the security risks
|
|
52
49
|
console.warn("\n WARNING: You are using a testing function to generate JWTs in your client application.\n This is NOT secure and should ONLY be used for initial development and testing purposes.\n\n In production:\n - NEVER expose your secret key in client-side code.\n - Refer to the documentation at https://docs.replyke.com to implement JWT signing on your backend.\n - Rotate your secret key periodically, especially after moving from testing to production.\n\n Failure to follow these practices can lead to security vulnerabilities.\n ");
|
|
53
|
-
return [4 /*yield*/, axios.post("/crypto/sign-testing-jwt", {
|
|
50
|
+
return [4 /*yield*/, axios.post("https://api.replyke.com/internal/crypto/sign-testing-jwt", {
|
|
54
51
|
projectId: projectId,
|
|
55
52
|
privateKey: privateKey,
|
|
56
53
|
payload: payload,
|
|
57
54
|
})];
|
|
58
|
-
case
|
|
55
|
+
case 1:
|
|
59
56
|
response = _c.sent();
|
|
60
57
|
return [2 /*return*/, response.data];
|
|
61
|
-
case
|
|
58
|
+
case 2:
|
|
62
59
|
err_1 = _c.sent();
|
|
63
60
|
handleError(err_1, "Failed to sign testing jwt: ");
|
|
64
|
-
return [3 /*break*/,
|
|
65
|
-
case
|
|
61
|
+
return [3 /*break*/, 3];
|
|
62
|
+
case 3: return [2 /*return*/];
|
|
66
63
|
}
|
|
67
64
|
});
|
|
68
65
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,SAAS,iBAAiB;IAA1B,iBAwCC;IAvCC,IAAM,cAAc,GAAG,gEAAO,EAQ7B;;YAPC,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,OAAO,aAAA;;;;;oBAOL,2CAA2C;oBAC3C,OAAO,CAAC,IAAI,CAAC,siBAUhB,CAAC,CAAC;oBAEkB,qBAAM,KAAK,CAAC,IAAI,CAC/B,0DAA0D,EAC1D;4BACE,SAAS,WAAA;4BACT,UAAU,YAAA;4BACV,OAAO,SAAA;yBACR,CACF,EAAA;;oBAPK,QAAQ,GAAG,SAOhB;oBAED,sBAAO,QAAQ,CAAC,IAAc,EAAC;;;oBAE/B,WAAW,CAAC,KAAG,EAAE,8BAA8B,CAAC,CAAC;;;;;SAEpD,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replyke/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.35",
|
|
4
|
+
"private": false,
|
|
4
5
|
"author": "Replyke, maintained by Yanay Tsabary",
|
|
5
6
|
"description": "Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.",
|
|
6
7
|
"keywords": [
|