@scaleway/auth-scw 1.2.0 → 1.2.1
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.
|
@@ -57,7 +57,7 @@ const AuthScwProvider = ({ clientSettings, IamV1Alpha1, IamUnauthenticatedV1Alph
|
|
|
57
57
|
const storedJWT = getStoredJWT(audienceId, storeManager);
|
|
58
58
|
if (storedJWT?.jwt) {
|
|
59
59
|
const { renewToken, token, jwt: currentJWT } = storedJWT;
|
|
60
|
-
if (currentJWT.expiresAt && !isExpired(new Date(currentJWT.expiresAt))) return {
|
|
60
|
+
if (currentJWT.expiresAt !== void 0 && !isExpired(new Date(currentJWT.expiresAt))) return {
|
|
61
61
|
jwt: currentJWT,
|
|
62
62
|
renewToken,
|
|
63
63
|
source: "storage",
|
|
@@ -17,9 +17,11 @@ const createLocalStorageBackend = () => ({
|
|
|
17
17
|
const keysToRemove = [];
|
|
18
18
|
for (let i = 0; i < globalThis.localStorage.length; i++) {
|
|
19
19
|
const key = globalThis.localStorage.key(i);
|
|
20
|
-
if (key?.startsWith(prefix)) keysToRemove.push(key);
|
|
20
|
+
if (key?.startsWith(prefix) === true) keysToRemove.push(key);
|
|
21
21
|
}
|
|
22
|
-
keysToRemove.forEach((key) =>
|
|
22
|
+
keysToRemove.forEach((key) => {
|
|
23
|
+
globalThis.localStorage.removeItem(key);
|
|
24
|
+
});
|
|
23
25
|
} catch {}
|
|
24
26
|
},
|
|
25
27
|
get(key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/auth-scw",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Auth Scaleway",
|
|
5
5
|
"homepage": "https://github.com/scaleway/scaleway-lib/tree/main/packages/auth-scw",
|
|
6
6
|
"bugs": {
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@scaleway/sdk-iam": "2.
|
|
29
|
+
"@scaleway/sdk-iam": "2.20.0",
|
|
30
30
|
"cookie": "2.0.1",
|
|
31
31
|
"date-fns": "4.4.0",
|
|
32
32
|
"zod": "4.6.5"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@scaleway/sdk-client": "2.12.
|
|
35
|
+
"@scaleway/sdk-client": "2.12.1",
|
|
36
36
|
"@scaleway/types": "1.2.0",
|
|
37
37
|
"@types/react": "19.3.0",
|
|
38
38
|
"react": "19.3.0"
|