@digilogiclabs/platform-core 1.28.0 → 1.29.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/dist/auth.d.mts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +22 -5
- package/dist/auth.js.map +1 -1
- package/dist/auth.mjs +22 -5
- package/dist/auth.mjs.map +1 -1
- package/dist/{env-Cgwf8ZG2.d.mts → env-CHg-CUuD.d.mts} +6 -0
- package/dist/{env-Cgwf8ZG2.d.ts → env-CHg-CUuD.d.ts} +6 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +27 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/auth.mjs
CHANGED
|
@@ -221,6 +221,10 @@ function buildKeycloakCallbacks(config) {
|
|
|
221
221
|
*/
|
|
222
222
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
223
223
|
async session({ session, token }) {
|
|
224
|
+
if (token.error === "RefreshTokenError") {
|
|
225
|
+
const { user: _revoked, accessToken: _stale, ...rest } = session;
|
|
226
|
+
return { ...rest, idToken: token.idToken, error: token.error };
|
|
227
|
+
}
|
|
224
228
|
const user = session.user;
|
|
225
229
|
if (user) {
|
|
226
230
|
user.id = token.id || token.sub;
|
|
@@ -698,11 +702,24 @@ async function checkRateLimit(operation, identifier, rule, options = {}) {
|
|
|
698
702
|
retryAfterSeconds: 0
|
|
699
703
|
};
|
|
700
704
|
} catch (error) {
|
|
701
|
-
options.logger?.error(
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
705
|
+
options.logger?.error(
|
|
706
|
+
rule.failClosed ? "Rate limit check failed, denying request (fail-closed rule)" : "Rate limit check failed, allowing request",
|
|
707
|
+
{
|
|
708
|
+
error: error instanceof Error ? error.message : String(error),
|
|
709
|
+
operation,
|
|
710
|
+
identifier
|
|
711
|
+
}
|
|
712
|
+
);
|
|
713
|
+
if (rule.failClosed) {
|
|
714
|
+
return {
|
|
715
|
+
allowed: false,
|
|
716
|
+
remaining: 0,
|
|
717
|
+
resetAt,
|
|
718
|
+
current: 0,
|
|
719
|
+
limit,
|
|
720
|
+
retryAfterSeconds: 30
|
|
721
|
+
};
|
|
722
|
+
}
|
|
706
723
|
return {
|
|
707
724
|
allowed: true,
|
|
708
725
|
remaining: limit,
|