@classic-homes/auth 1.14.0 → 1.22.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.
@@ -1,3 +1,3 @@
1
- export { authActions, authStore, currentUser, isAuthenticated } from './chunk-XWJ54R6J.js';
2
- import './chunk-4SLNFY2N.js';
1
+ export { authActions, authStore, currentUser, isAuthenticated } from './chunk-B6MOGO74.js';
2
+ import './chunk-LFNG4XAP.js';
3
3
  import './chunk-PYCXNOMA.js';
@@ -1,4 +1,4 @@
1
- import { authApi } from './chunk-4SLNFY2N.js';
1
+ import { authApi } from './chunk-LFNG4XAP.js';
2
2
  import { isInitialized, getConfig, hasRole, hasAnyRole, hasAllRoles, decodeJWT, getStorage, getDefaultStorage } from './chunk-PYCXNOMA.js';
3
3
 
4
4
  // src/svelte/stores/auth.svelte.ts
@@ -58,7 +58,7 @@ function writeStoredTokens(accessToken, refreshToken) {
58
58
  }
59
59
  async function syncSvelteStore(apply) {
60
60
  try {
61
- const { authStore } = await import('./auth.svelte-AIRJEWTG.js');
61
+ const { authStore } = await import('./auth.svelte-64QCTV2B.js');
62
62
  apply(authStore);
63
63
  } catch {
64
64
  }
@@ -445,7 +445,7 @@ var authApi = {
445
445
  */
446
446
  async getProfile(customFetch) {
447
447
  const response = await api.get("/auth/profile", true, customFetch);
448
- return response;
448
+ return extractData(response);
449
449
  },
450
450
  /**
451
451
  * Update the current user's profile.
@@ -1,4 +1,4 @@
1
- import { authApi } from './chunk-4SLNFY2N.js';
1
+ import { authApi } from './chunk-LFNG4XAP.js';
2
2
  import { getUserRoles, hasAnyRole } from './chunk-PYCXNOMA.js';
3
3
 
4
4
  // src/core/guards.ts
@@ -59,7 +59,7 @@ var AuthService = class {
59
59
  }
60
60
  if (options?.autoSetAuth !== false && !isMfaChallengeResponse(response)) {
61
61
  try {
62
- const { authStore } = await import('./auth.svelte-AIRJEWTG.js');
62
+ const { authStore } = await import('./auth.svelte-64QCTV2B.js');
63
63
  authStore.setAuth(
64
64
  response.accessToken,
65
65
  response.refreshToken,
@@ -245,7 +245,7 @@ var AuthService = class {
245
245
  }
246
246
  if (options?.autoSetAuth !== false) {
247
247
  try {
248
- const { authStore } = await import('./auth.svelte-AIRJEWTG.js');
248
+ const { authStore } = await import('./auth.svelte-64QCTV2B.js');
249
249
  authStore.setAuth(
250
250
  response.accessToken,
251
251
  response.refreshToken,
@@ -1,5 +1,5 @@
1
- import { authService } from './chunk-2IEYKV42.js';
2
- import { authStore, currentUser, isAuthenticated, authActions } from './chunk-XWJ54R6J.js';
1
+ import { authService } from './chunk-S5LHUKA5.js';
2
+ import { authStore, currentUser, isAuthenticated, authActions } from './chunk-B6MOGO74.js';
3
3
  import { isInitialized, initAuth, getUserRoles } from './chunk-PYCXNOMA.js';
4
4
 
5
5
  // src/svelte/guards/auth-guard.ts
@@ -1,3 +1,3 @@
1
- export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from '../chunk-2IEYKV42.js';
2
- export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, initCrossTabSync, refreshSession, updateStoredTokens } from '../chunk-4SLNFY2N.js';
1
+ export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from '../chunk-S5LHUKA5.js';
2
+ export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, initCrossTabSync, refreshSession, updateStoredTokens } from '../chunk-LFNG4XAP.js';
3
3
  export { ROLE_HIERARCHY, ROLE_NAMES, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, extractClaims, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isInitialized, isTokenExpired, resetConfig } from '../chunk-PYCXNOMA.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './chunk-VLDCDFEN.js';
2
- export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from './chunk-2IEYKV42.js';
3
- export { authActions, authStore, currentUser, isAuthenticated } from './chunk-XWJ54R6J.js';
4
- export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, initCrossTabSync, refreshSession, updateStoredTokens } from './chunk-4SLNFY2N.js';
1
+ export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './chunk-WHNMH73M.js';
2
+ export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from './chunk-S5LHUKA5.js';
3
+ export { authActions, authStore, currentUser, isAuthenticated } from './chunk-B6MOGO74.js';
4
+ export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, initCrossTabSync, refreshSession, updateStoredTokens } from './chunk-LFNG4XAP.js';
5
5
  export { ROLE_HIERARCHY, ROLE_NAMES, computePrimaryRole, createMemoryStorage, createSessionStorage, decodeJWT, extractClaims, getConfig, getDefaultStorage, getEffectiveLevel, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, getUserRoles, hasAllRoles, hasAnyRole, hasRole, initAuth, isInitialized, isTokenExpired, resetConfig } from './chunk-PYCXNOMA.js';
@@ -1,5 +1,5 @@
1
- export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-VLDCDFEN.js';
2
- export { RoleDeniedError, formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials, isRoleDeniedError } from '../chunk-2IEYKV42.js';
3
- export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-XWJ54R6J.js';
4
- import '../chunk-4SLNFY2N.js';
1
+ export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-WHNMH73M.js';
2
+ export { RoleDeniedError, formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials, isRoleDeniedError } from '../chunk-S5LHUKA5.js';
3
+ export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-B6MOGO74.js';
4
+ import '../chunk-LFNG4XAP.js';
5
5
  export { initAuth, isInitialized } from '../chunk-PYCXNOMA.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/auth",
3
- "version": "1.14.0",
3
+ "version": "1.22.1",
4
4
  "description": "Authentication services and Svelte bindings for Classic Theme apps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -61,6 +61,7 @@
61
61
  "devDependencies": {
62
62
  "svelte": "^5.0.0",
63
63
  "tsup": "^8.0.0",
64
- "typescript": "^5.3.0"
64
+ "typescript": "^5.3.0",
65
+ "vitest": "^4.1.10"
65
66
  }
66
67
  }