@replyke/core 5.0.0-beta.32 → 5.0.0-beta.34
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.
|
@@ -43,16 +43,14 @@ var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"))
|
|
|
43
43
|
var handleError_1 = require("../../utils/handleError");
|
|
44
44
|
function useSignTestingJwt() {
|
|
45
45
|
var _this = this;
|
|
46
|
+
var axios = (0, useAxiosPrivate_1.default)();
|
|
46
47
|
var signTestingJwt = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
47
|
-
var
|
|
48
|
+
var response, err_1;
|
|
48
49
|
var projectId = _b.projectId, privateKey = _b.privateKey, payload = _b.payload;
|
|
49
50
|
return __generator(this, function (_c) {
|
|
50
51
|
switch (_c.label) {
|
|
51
52
|
case 0:
|
|
52
|
-
|
|
53
|
-
_c.label = 1;
|
|
54
|
-
case 1:
|
|
55
|
-
_c.trys.push([1, 3, , 4]);
|
|
53
|
+
_c.trys.push([0, 2, , 3]);
|
|
56
54
|
// Warn developers about the security risks
|
|
57
55
|
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
56
|
return [4 /*yield*/, axios.post("/crypto/sign-testing-jwt", {
|
|
@@ -60,14 +58,14 @@ function useSignTestingJwt() {
|
|
|
60
58
|
privateKey: privateKey,
|
|
61
59
|
payload: payload,
|
|
62
60
|
})];
|
|
63
|
-
case
|
|
61
|
+
case 1:
|
|
64
62
|
response = _c.sent();
|
|
65
63
|
return [2 /*return*/, response.data];
|
|
66
|
-
case
|
|
64
|
+
case 2:
|
|
67
65
|
err_1 = _c.sent();
|
|
68
66
|
(0, handleError_1.handleError)(err_1, "Failed to sign testing jwt: ");
|
|
69
|
-
return [3 /*break*/,
|
|
70
|
-
case
|
|
67
|
+
return [3 /*break*/, 3];
|
|
68
|
+
case 3: return [2 /*return*/];
|
|
71
69
|
}
|
|
72
70
|
});
|
|
73
71
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAA2D;AAC3D,uDAAsD;AAEtD,SAAS,iBAAiB;IAA1B,
|
|
1
|
+
{"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAA2D;AAC3D,uDAAsD;AAEtD,SAAS,iBAAiB;IAA1B,iBAuCC;IAtCC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEhC,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,CAAC,0BAA0B,EAAE;4BAC5D,SAAS,WAAA;4BACT,UAAU,YAAA;4BACV,OAAO,SAAA;yBACR,CAAC,EAAA;;oBAJI,QAAQ,GAAG,SAIf;oBAEF,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"}
|
|
@@ -38,16 +38,14 @@ import useAxiosPrivate from "../../config/useAxiosPrivate";
|
|
|
38
38
|
import { handleError } from "../../utils/handleError";
|
|
39
39
|
function useSignTestingJwt() {
|
|
40
40
|
var _this = this;
|
|
41
|
+
var axios = useAxiosPrivate();
|
|
41
42
|
var signTestingJwt = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
42
|
-
var
|
|
43
|
+
var response, err_1;
|
|
43
44
|
var projectId = _b.projectId, privateKey = _b.privateKey, payload = _b.payload;
|
|
44
45
|
return __generator(this, function (_c) {
|
|
45
46
|
switch (_c.label) {
|
|
46
47
|
case 0:
|
|
47
|
-
|
|
48
|
-
_c.label = 1;
|
|
49
|
-
case 1:
|
|
50
|
-
_c.trys.push([1, 3, , 4]);
|
|
48
|
+
_c.trys.push([0, 2, , 3]);
|
|
51
49
|
// Warn developers about the security risks
|
|
52
50
|
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
51
|
return [4 /*yield*/, axios.post("/crypto/sign-testing-jwt", {
|
|
@@ -55,14 +53,14 @@ function useSignTestingJwt() {
|
|
|
55
53
|
privateKey: privateKey,
|
|
56
54
|
payload: payload,
|
|
57
55
|
})];
|
|
58
|
-
case
|
|
56
|
+
case 1:
|
|
59
57
|
response = _c.sent();
|
|
60
58
|
return [2 /*return*/, response.data];
|
|
61
|
-
case
|
|
59
|
+
case 2:
|
|
62
60
|
err_1 = _c.sent();
|
|
63
61
|
handleError(err_1, "Failed to sign testing jwt: ");
|
|
64
|
-
return [3 /*break*/,
|
|
65
|
-
case
|
|
62
|
+
return [3 /*break*/, 3];
|
|
63
|
+
case 3: return [2 /*return*/];
|
|
66
64
|
}
|
|
67
65
|
});
|
|
68
66
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,SAAS,iBAAiB;IAA1B,
|
|
1
|
+
{"version":3,"file":"useSignTestingJwt.js","sourceRoot":"","sources":["../../../../src/hooks/crypto/useSignTestingJwt.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,SAAS,iBAAiB;IAA1B,iBAuCC;IAtCC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,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,CAAC,0BAA0B,EAAE;4BAC5D,SAAS,WAAA;4BACT,UAAU,YAAA;4BACV,OAAO,SAAA;yBACR,CAAC,EAAA;;oBAJI,QAAQ,GAAG,SAIf;oBAEF,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.34",
|
|
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": [
|