kuzzle 2.51.0 → 2.52.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.
|
@@ -498,10 +498,17 @@ class AuthController extends baseController_1.NativeController {
|
|
|
498
498
|
async refreshToken(request) {
|
|
499
499
|
this.assertIsAuthenticated(request);
|
|
500
500
|
const strategy = request.input.args?.strategy;
|
|
501
|
-
|
|
501
|
+
let expiresIn = request.input.args?.expiresIn;
|
|
502
|
+
if (strategy && strategy !== "local") {
|
|
503
|
+
/**
|
|
504
|
+
* Local strategy is a specific one that is meant to end the core of kuzzle
|
|
505
|
+
* For now we avoid entering here if someone mistakenly specify the "local" strategy
|
|
506
|
+
* // TODO remove this && strategy !== "local" condition once we properly removed the auth local plugin
|
|
507
|
+
*/
|
|
502
508
|
try {
|
|
503
509
|
const refreshTokenMethod = globalThis.kuzzle.pluginsManager.getStrategyMethod(strategy, "refreshToken");
|
|
504
|
-
await refreshTokenMethod(request);
|
|
510
|
+
const result = await refreshTokenMethod(request);
|
|
511
|
+
expiresIn = result?.expiresIn || expiresIn;
|
|
505
512
|
}
|
|
506
513
|
catch (err) {
|
|
507
514
|
/**
|
|
@@ -516,7 +523,7 @@ class AuthController extends baseController_1.NativeController {
|
|
|
516
523
|
throw securityError.get("refresh_forbidden", request.context.token.jwt);
|
|
517
524
|
}
|
|
518
525
|
}
|
|
519
|
-
const token = await this.ask("core:security:token:refresh", request.context.user, request.context.token,
|
|
526
|
+
const token = await this.ask("core:security:token:refresh", request.context.user, request.context.token, expiresIn);
|
|
520
527
|
return this._sendToken(token, request);
|
|
521
528
|
}
|
|
522
529
|
assertIsAuthenticated(request) {
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle",
|
|
3
3
|
"author": "The Kuzzle Team <support@kuzzle.io>",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.52.0",
|
|
5
5
|
"description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rm -Rf ./dist && tsc && node ./bin/copy-protobuf.js",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle",
|
|
3
3
|
"author": "The Kuzzle Team <support@kuzzle.io>",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.52.0",
|
|
5
5
|
"description": "Kuzzle is an open-source solution that handles all the data management through a secured API, with a large choice of protocols.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rm -Rf ./dist && tsc && node ./bin/copy-protobuf.js",
|