@classic-homes/auth 0.1.28 → 0.1.30
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.svelte-PKMR4LYT.js → auth.svelte-CIDAK774.js} +2 -2
- package/dist/{chunk-IO2LIH4I.js → chunk-3LY565CA.js} +1 -1
- package/dist/{chunk-U2YM3E3Q.js → chunk-FSUP2LAZ.js} +1 -1
- package/dist/{chunk-MI4B4ZRK.js → chunk-LYTYYOPU.js} +4 -3
- package/dist/{chunk-MY664247.js → chunk-N5DUPSOL.js} +3 -3
- package/dist/core/index.js +2 -2
- package/dist/index.js +4 -4
- package/dist/svelte/index.js +3 -3
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-FSUP2LAZ.js';
|
|
2
|
+
import './chunk-LYTYYOPU.js';
|
|
3
3
|
import './chunk-DCGC6CNV.js';
|
|
@@ -53,7 +53,7 @@ function updateStoredTokens(accessToken, refreshToken) {
|
|
|
53
53
|
parsed.accessToken = accessToken;
|
|
54
54
|
parsed.refreshToken = refreshToken;
|
|
55
55
|
storage.setItem(storageKey, JSON.stringify(parsed));
|
|
56
|
-
import('./auth.svelte-
|
|
56
|
+
import('./auth.svelte-CIDAK774.js').then(({ authStore }) => {
|
|
57
57
|
authStore.updateTokens(accessToken, refreshToken);
|
|
58
58
|
}).catch(() => {
|
|
59
59
|
});
|
|
@@ -84,8 +84,9 @@ async function refreshAccessToken() {
|
|
|
84
84
|
const apiResponse = await response.json();
|
|
85
85
|
const data = apiResponse.data;
|
|
86
86
|
const tokens = data && typeof data === "object" && "data" in data ? data.data : data;
|
|
87
|
-
if (tokens?.accessToken
|
|
88
|
-
|
|
87
|
+
if (tokens?.accessToken) {
|
|
88
|
+
const newRefreshToken = tokens.refreshToken ?? refreshToken;
|
|
89
|
+
updateStoredTokens(tokens.accessToken, newRefreshToken);
|
|
89
90
|
onTokenRefreshed(tokens.accessToken);
|
|
90
91
|
return true;
|
|
91
92
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { authApi } from './chunk-
|
|
1
|
+
import { authApi } from './chunk-LYTYYOPU.js';
|
|
2
2
|
|
|
3
3
|
// src/core/guards.ts
|
|
4
4
|
function isMfaChallengeResponse(response) {
|
|
@@ -29,7 +29,7 @@ var AuthService = class {
|
|
|
29
29
|
const response = await authApi.login(credentials);
|
|
30
30
|
if (options?.autoSetAuth !== false && !isMfaChallengeResponse(response)) {
|
|
31
31
|
try {
|
|
32
|
-
const { authStore } = await import('./auth.svelte-
|
|
32
|
+
const { authStore } = await import('./auth.svelte-CIDAK774.js');
|
|
33
33
|
authStore.setAuth(
|
|
34
34
|
response.accessToken,
|
|
35
35
|
response.refreshToken,
|
|
@@ -204,7 +204,7 @@ var AuthService = class {
|
|
|
204
204
|
const response = await authApi.verifyMFAChallenge(data);
|
|
205
205
|
if (options?.autoSetAuth !== false) {
|
|
206
206
|
try {
|
|
207
|
-
const { authStore } = await import('./auth.svelte-
|
|
207
|
+
const { authStore } = await import('./auth.svelte-CIDAK774.js');
|
|
208
208
|
authStore.setAuth(
|
|
209
209
|
response.accessToken,
|
|
210
210
|
response.refreshToken,
|
package/dist/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AuthService, authService, getAvailableMethods, getMfaToken, isLoginSuccessResponse, isMfaChallengeResponse } from '../chunk-
|
|
2
|
-
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from '../chunk-
|
|
1
|
+
export { AuthService, authService, getAvailableMethods, getMfaToken, isLoginSuccessResponse, isMfaChallengeResponse } from '../chunk-N5DUPSOL.js';
|
|
2
|
+
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from '../chunk-LYTYYOPU.js';
|
|
3
3
|
export { decodeJWT, extractClaims, getConfig, getDefaultStorage, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, initAuth, isInitialized, isTokenExpired, resetConfig } from '../chunk-DCGC6CNV.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { AuthService, authService, getAvailableMethods, getMfaToken, isLoginSuccessResponse, isMfaChallengeResponse } from './chunk-
|
|
2
|
-
export { checkAuth, createAuthGuard, protectedLoad, requireAuth, requirePermission, requireRole } from './chunk-
|
|
3
|
-
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-
|
|
4
|
-
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from './chunk-
|
|
1
|
+
export { AuthService, authService, getAvailableMethods, getMfaToken, isLoginSuccessResponse, isMfaChallengeResponse } from './chunk-N5DUPSOL.js';
|
|
2
|
+
export { checkAuth, createAuthGuard, protectedLoad, requireAuth, requirePermission, requireRole } from './chunk-3LY565CA.js';
|
|
3
|
+
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-FSUP2LAZ.js';
|
|
4
|
+
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from './chunk-LYTYYOPU.js';
|
|
5
5
|
export { decodeJWT, extractClaims, getConfig, getDefaultStorage, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, initAuth, isInitialized, isTokenExpired, resetConfig } from './chunk-DCGC6CNV.js';
|
package/dist/svelte/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { checkAuth, createAuthGuard, protectedLoad, requireAuth, requirePermission, requireRole } from '../chunk-
|
|
2
|
-
export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { checkAuth, createAuthGuard, protectedLoad, requireAuth, requirePermission, requireRole } from '../chunk-3LY565CA.js';
|
|
2
|
+
export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-FSUP2LAZ.js';
|
|
3
|
+
import '../chunk-LYTYYOPU.js';
|
|
4
4
|
import '../chunk-DCGC6CNV.js';
|