@classic-homes/auth 0.1.52 → 0.1.55

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-TUFSFAAI.js';
2
- import './chunk-U5E4T4NS.js';
1
+ export { authActions, authStore, currentUser, isAuthenticated } from './chunk-BK34CVH5.js';
2
+ import './chunk-GRQL5FSH.js';
3
3
  import './chunk-EM7PUNZB.js';
@@ -1,4 +1,4 @@
1
- import { authApi } from './chunk-U5E4T4NS.js';
1
+ import { authApi } from './chunk-GRQL5FSH.js';
2
2
  import { decodeJWT, isInitialized, getConfig, getStorage, getDefaultStorage } from './chunk-EM7PUNZB.js';
3
3
 
4
4
  // src/svelte/stores/auth.svelte.ts
@@ -3,7 +3,11 @@ import { getConfig, getStorage, getFetch, isValidRedirectUrl } from './chunk-EM7
3
3
  // src/core/client.ts
4
4
  var isRefreshing = false;
5
5
  var refreshSubscribers = [];
6
+ var MAX_REFRESH_SUBSCRIBERS = 100;
6
7
  function subscribeTokenRefresh(cb) {
8
+ if (refreshSubscribers.length >= MAX_REFRESH_SUBSCRIBERS) {
9
+ throw new Error("Too many concurrent requests waiting for token refresh. Please try again.");
10
+ }
7
11
  refreshSubscribers.push(cb);
8
12
  return () => {
9
13
  const idx = refreshSubscribers.indexOf(cb);
@@ -11,8 +15,15 @@ function subscribeTokenRefresh(cb) {
11
15
  };
12
16
  }
13
17
  function onTokenRefreshed(token) {
14
- refreshSubscribers.forEach((cb) => cb(token));
18
+ const subs = refreshSubscribers;
15
19
  refreshSubscribers = [];
20
+ subs.forEach((cb) => {
21
+ try {
22
+ cb(token);
23
+ } catch (e) {
24
+ console.error("Token refresh subscriber error:", e);
25
+ }
26
+ });
16
27
  }
17
28
  function getAccessToken() {
18
29
  const config = getConfig();
@@ -51,18 +62,17 @@ function updateStoredTokens(accessToken, refreshToken) {
51
62
  const config = getConfig();
52
63
  const storage = getStorage();
53
64
  const storageKey = config.storageKey ?? "classic_auth";
54
- const authData = storage.getItem(storageKey);
55
65
  let parsed = {};
56
- if (authData) {
57
- try {
58
- parsed = JSON.parse(authData);
59
- } catch {
60
- }
66
+ try {
67
+ const authData = storage.getItem(storageKey);
68
+ if (authData) parsed = JSON.parse(authData);
69
+ } catch {
61
70
  }
62
71
  parsed.accessToken = accessToken;
63
72
  parsed.refreshToken = refreshToken;
73
+ parsed._version = (parsed._version || 0) + 1;
64
74
  storage.setItem(storageKey, JSON.stringify(parsed));
65
- import('./auth.svelte-JXZ7XEE5.js').then(({ authStore }) => {
75
+ import('./auth.svelte-BBLX2MKB.js').then(({ authStore }) => {
66
76
  authStore.updateTokens(accessToken, refreshToken);
67
77
  }).catch(() => {
68
78
  });
@@ -132,10 +142,20 @@ function extractData(response) {
132
142
  return response;
133
143
  }
134
144
  async function apiRequest(endpoint, options = {}) {
135
- const { authenticated = false, customFetch, body, ...fetchOptions } = options;
145
+ const { authenticated = false, customFetch, body, timeout, signal, ...fetchOptions } = options;
136
146
  const config = getConfig();
137
147
  const fetchFn = customFetch ?? getFetch();
138
148
  const url = endpoint.startsWith("http") ? endpoint : `${config.baseUrl}${endpoint}`;
149
+ const timeoutMs = timeout ?? config.requestTimeout ?? 3e4;
150
+ const controller = new AbortController();
151
+ const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
152
+ if (signal) {
153
+ if (signal.aborted) {
154
+ controller.abort();
155
+ } else {
156
+ signal.addEventListener("abort", () => controller.abort(), { once: true });
157
+ }
158
+ }
139
159
  const headers = {
140
160
  "Content-Type": "application/json",
141
161
  ...fetchOptions.headers
@@ -154,8 +174,10 @@ async function apiRequest(endpoint, options = {}) {
154
174
  const response = await fetchFn(url, {
155
175
  ...fetchOptions,
156
176
  headers,
157
- body: body ? JSON.stringify(body) : void 0
177
+ body: body ? JSON.stringify(body) : void 0,
178
+ signal: controller.signal
158
179
  });
180
+ clearTimeout(timeoutId);
159
181
  if (response.status === 401 && authenticated && typeof window !== "undefined") {
160
182
  if (!isRefreshing) {
161
183
  isRefreshing = true;
@@ -173,7 +195,7 @@ async function apiRequest(endpoint, options = {}) {
173
195
  return new Promise((resolve, reject) => {
174
196
  let settled = false;
175
197
  let unsubscribe = null;
176
- const timeoutId = setTimeout(() => {
198
+ const timeoutId2 = setTimeout(() => {
177
199
  if (!settled) {
178
200
  settled = true;
179
201
  unsubscribe?.();
@@ -183,7 +205,7 @@ async function apiRequest(endpoint, options = {}) {
183
205
  unsubscribe = subscribeTokenRefresh(() => {
184
206
  if (!settled) {
185
207
  settled = true;
186
- clearTimeout(timeoutId);
208
+ clearTimeout(timeoutId2);
187
209
  apiRequest(endpoint, options).then(resolve).catch(reject);
188
210
  }
189
211
  });
@@ -233,6 +255,10 @@ async function apiRequest(endpoint, options = {}) {
233
255
  }
234
256
  return data;
235
257
  } catch (error) {
258
+ clearTimeout(timeoutId);
259
+ if (error instanceof DOMException && error.name === "AbortError") {
260
+ throw new Error(`Request timed out after ${timeoutMs}ms`);
261
+ }
236
262
  if (error instanceof Error) {
237
263
  throw error;
238
264
  }
@@ -640,6 +666,11 @@ var authApi = {
640
666
  const result = await response.json();
641
667
  const authorizationUrl = extractData(result).authorizationUrl;
642
668
  if (authorizationUrl) {
669
+ if (!isValidRedirectUrl(authorizationUrl)) {
670
+ throw new Error(
671
+ "SSO link failed: authorization URL is not in the list of allowed redirect origins"
672
+ );
673
+ }
643
674
  window.location.href = authorizationUrl;
644
675
  }
645
676
  },
@@ -1,5 +1,5 @@
1
- import { authService } from './chunk-GOKAXJJS.js';
2
- import { authStore, currentUser, isAuthenticated, authActions } from './chunk-TUFSFAAI.js';
1
+ import { authService } from './chunk-TUHQ4FHC.js';
2
+ import { authStore, currentUser, isAuthenticated, authActions } from './chunk-BK34CVH5.js';
3
3
  import { isInitialized, initAuth } from './chunk-EM7PUNZB.js';
4
4
 
5
5
  // src/svelte/guards/auth-guard.ts
@@ -1,4 +1,4 @@
1
- import { authApi } from './chunk-U5E4T4NS.js';
1
+ import { authApi } from './chunk-GRQL5FSH.js';
2
2
 
3
3
  // src/core/guards.ts
4
4
  function isMfaChallengeResponse(response) {
@@ -60,7 +60,7 @@ var AuthService = class {
60
60
  }
61
61
  if (options?.autoSetAuth !== false && !isMfaChallengeResponse(response)) {
62
62
  try {
63
- const { authStore } = await import('./auth.svelte-JXZ7XEE5.js');
63
+ const { authStore } = await import('./auth.svelte-BBLX2MKB.js');
64
64
  authStore.setAuth(
65
65
  response.accessToken,
66
66
  response.refreshToken,
@@ -246,7 +246,7 @@ var AuthService = class {
246
246
  }
247
247
  if (options?.autoSetAuth !== false) {
248
248
  try {
249
- const { authStore } = await import('./auth.svelte-JXZ7XEE5.js');
249
+ const { authStore } = await import('./auth.svelte-BBLX2MKB.js');
250
250
  authStore.setAuth(
251
251
  response.accessToken,
252
252
  response.refreshToken,
@@ -1,6 +1,6 @@
1
- import { L as LoginCredentials, h as LoginResponse, j as LogoutResponse, R as RegisterData, k as RegisterResponse, U as User, u as ProfileUpdateData, v as ChangePasswordData, l as Session, m as ApiKey, C as CreateApiKeyRequest, n as CreateApiKeyResponse, o as MFAStatus, M as MFASetupResponse, p as MFAChallengeData, D as Device, q as UserPreferences, s as LinkedAccount, t as SecurityEvent, P as Pagination } from '../types-CKcLRCI_.js';
2
- export { A as AuthConfig, f as AuthState, w as ResetPasswordData, S as SSOConfig, e as StorageAdapter, g as getConfig, b as getDefaultStorage, d as getFetch, c as getStorage, i as initAuth, a as isInitialized, r as resetConfig } from '../types-CKcLRCI_.js';
3
- export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, c as getAvatarFallback, g as getDisplayName, e as getGreeting, d as getUserEmail, b as getUserInitials, i as isRoleDeniedError } from '../user-utils-Bi3-FHxY.js';
1
+ import { e as LoginCredentials, f as LoginResponse, g as LogoutResponse, R as RegisterData, k as RegisterResponse, U as User, j as ProfileUpdateData, C as ChangePasswordData, n as Session, A as ApiKey, c as CreateApiKeyRequest, d as CreateApiKeyResponse, i as MFAStatus, h as MFASetupResponse, M as MFAChallengeData, D as Device, p as UserPreferences, L as LinkedAccount, m as SecurityEvent, P as Pagination } from '../types-BRxyphcX.js';
2
+ export { a as AuthConfig, b as AuthState, l as ResetPasswordData, S as SSOConfig, o as StorageAdapter, q as getConfig, r as getDefaultStorage, s as getFetch, t as getStorage, u as initAuth, v as isInitialized, w as resetConfig } from '../types-BRxyphcX.js';
3
+ export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from '../user-utils-BSbNN3Hb.js';
4
4
 
5
5
  /**
6
6
  * HTTP Client
@@ -8,13 +8,17 @@ export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDe
8
8
  * A configurable HTTP client for making API requests.
9
9
  * Handles authentication headers, token refresh, and error handling.
10
10
  */
11
- interface ApiRequestOptions extends Omit<RequestInit, 'body'> {
11
+ interface ApiRequestOptions extends Omit<RequestInit, 'body' | 'signal'> {
12
12
  /** Whether to include auth headers */
13
13
  authenticated?: boolean;
14
14
  /** Custom fetch implementation for this request */
15
15
  customFetch?: typeof fetch;
16
16
  /** Request body (will be JSON stringified) */
17
17
  body?: unknown;
18
+ /** Request timeout in ms (overrides global config.requestTimeout) */
19
+ timeout?: number;
20
+ /** AbortSignal for manual cancellation */
21
+ signal?: AbortSignal;
18
22
  }
19
23
  interface ApiResponse<T = unknown> {
20
24
  data?: T;
@@ -42,6 +46,10 @@ declare function getSessionToken(): string | null;
42
46
  /**
43
47
  * Update stored tokens.
44
48
  * Also updates the Svelte auth store if available.
49
+ *
50
+ * Note: The read-modify-write on localStorage is not atomic across tabs.
51
+ * A version counter is used to detect and discard stale writes from other tabs.
52
+ * The `storage` event listener (set up via `initCrossTabSync`) keeps tabs in sync.
45
53
  */
46
54
  declare function updateStoredTokens(accessToken: string, refreshToken: string): void;
47
55
  /**
@@ -50,6 +58,10 @@ declare function updateStoredTokens(accessToken: string, refreshToken: string):
50
58
  declare function clearStoredAuth(): void;
51
59
  /**
52
60
  * Helper to extract data from CHAPI response wrapper.
61
+ *
62
+ * WARNING: The final fallback returns `response as T` without runtime
63
+ * validation. Callers should validate the shape of the returned data
64
+ * at trust boundaries (e.g., after network requests).
53
65
  */
54
66
  declare function extractData<T>(response: {
55
67
  data?: {
@@ -304,7 +316,10 @@ declare function getAvailableMethods(response: LoginResponse): string[];
304
316
  * JWT Utilities
305
317
  *
306
318
  * Simple JWT decoder utilities for extracting payload data.
307
- * Note: These functions do NOT verify signatures - they only extract payloads.
319
+ *
320
+ * SECURITY: These functions do NOT verify signatures — they only extract payloads.
321
+ * Permissions and roles decoded from JWTs are for **UI display only**.
322
+ * All authorization decisions MUST be enforced server-side.
308
323
  */
309
324
  interface JWTPayload {
310
325
  /** Subject (usually user ID) */
@@ -323,6 +338,10 @@ interface JWTPayload {
323
338
  /**
324
339
  * Decode a JWT token and extract its payload.
325
340
  *
341
+ * **SECURITY:** No signature verification is performed. The returned claims
342
+ * (including `roles` and `permissions`) are for client-side UI hints only.
343
+ * Never use these claims for authorization without server-side verification.
344
+ *
326
345
  * @param token - The JWT token string
327
346
  * @returns The decoded payload, or null if decoding fails
328
347
  *
@@ -1,3 +1,3 @@
1
- export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from '../chunk-GOKAXJJS.js';
2
- export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from '../chunk-U5E4T4NS.js';
1
+ export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from '../chunk-TUHQ4FHC.js';
2
+ export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from '../chunk-GRQL5FSH.js';
3
3
  export { decodeJWT, extractClaims, getConfig, getDefaultStorage, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, initAuth, isInitialized, isTokenExpired, resetConfig } from '../chunk-EM7PUNZB.js';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { m as ApiKey, A as AuthConfig, f as AuthState, v as ChangePasswordData, C as CreateApiKeyRequest, n as CreateApiKeyResponse, D as Device, s as LinkedAccount, L as LoginCredentials, h as LoginResponse, j as LogoutResponse, p as MFAChallengeData, M as MFASetupResponse, o as MFAStatus, P as Pagination, u as ProfileUpdateData, R as RegisterData, k as RegisterResponse, w as ResetPasswordData, S as SSOConfig, t as SecurityEvent, l as Session, e as StorageAdapter, U as User, q as UserPreferences, g as getConfig, b as getDefaultStorage, d as getFetch, c as getStorage, i as initAuth, a as isInitialized, r as resetConfig } from './types-CKcLRCI_.js';
1
+ export { A as ApiKey, a as AuthConfig, b as AuthState, C as ChangePasswordData, c as CreateApiKeyRequest, d as CreateApiKeyResponse, D as Device, L as LinkedAccount, e as LoginCredentials, f as LoginResponse, g as LogoutResponse, M as MFAChallengeData, h as MFASetupResponse, i as MFAStatus, P as Pagination, j as ProfileUpdateData, R as RegisterData, k as RegisterResponse, l as ResetPasswordData, S as SSOConfig, m as SecurityEvent, n as Session, o as StorageAdapter, U as User, p as UserPreferences, q as getConfig, r as getDefaultStorage, s as getFetch, t as getStorage, u as initAuth, v as isInitialized, w as resetConfig } from './types-BRxyphcX.js';
2
2
  export { ApiRequestOptions, ApiResponse, JWTPayload, api, apiRequest, authApi, clearStoredAuth, decodeJWT, extractClaims, extractData, getAccessToken, getAvailableMethods, getMfaToken, getRefreshToken, getSessionToken, getTokenExpiration, getTokenRemainingTime, isLoginSuccessResponse, isMfaChallengeResponse, isTokenExpired, updateStoredTokens } from './core/index.js';
3
- export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, c as getAvatarFallback, g as getDisplayName, e as getGreeting, d as getUserEmail, b as getUserInitials, i as isRoleDeniedError } from './user-utils-Bi3-FHxY.js';
3
+ export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from './user-utils-BSbNN3Hb.js';
4
4
  export { AuthClient, AuthGuardOptions, AuthGuardResult, AuthHookOptions, CreateAuthClientOptions, NavFilterOptions, RoleRestrictedItem, authActions, authStore, canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, currentUser, filterByAccess, filterNavSections, isAuthenticated, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './svelte/index.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-RKHRCHOI.js';
2
- export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from './chunk-GOKAXJJS.js';
3
- export { authActions, authStore, currentUser, isAuthenticated } from './chunk-TUFSFAAI.js';
4
- export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from './chunk-U5E4T4NS.js';
1
+ export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from './chunk-RKSETJ4V.js';
2
+ export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from './chunk-TUHQ4FHC.js';
3
+ export { authActions, authStore, currentUser, isAuthenticated } from './chunk-BK34CVH5.js';
4
+ export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from './chunk-GRQL5FSH.js';
5
5
  export { decodeJWT, extractClaims, getConfig, getDefaultStorage, getFetch, getStorage, getTokenExpiration, getTokenRemainingTime, initAuth, isInitialized, isTokenExpired, resetConfig } from './chunk-EM7PUNZB.js';
@@ -1,7 +1,7 @@
1
- import { f as AuthState, U as User, A as AuthConfig } from '../types-CKcLRCI_.js';
2
- export { i as initAuth, a as isInitialized } from '../types-CKcLRCI_.js';
3
- import { a as authService } from '../user-utils-Bi3-FHxY.js';
4
- export { R as RoleDeniedError, f as formatUserRoles, c as getAvatarFallback, g as getDisplayName, e as getGreeting, d as getUserEmail, b as getUserInitials, i as isRoleDeniedError } from '../user-utils-Bi3-FHxY.js';
1
+ import { b as AuthState, U as User, a as AuthConfig } from '../types-BRxyphcX.js';
2
+ export { u as initAuth, v as isInitialized } from '../types-BRxyphcX.js';
3
+ import { a as authService } from '../user-utils-BSbNN3Hb.js';
4
+ export { R as RoleDeniedError, f as formatUserRoles, g as getAvatarFallback, b as getDisplayName, c as getGreeting, d as getUserEmail, e as getUserInitials, i as isRoleDeniedError } from '../user-utils-BSbNN3Hb.js';
5
5
 
6
6
  /**
7
7
  * Auth Store
@@ -1,5 +1,5 @@
1
- export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-RKHRCHOI.js';
2
- export { RoleDeniedError, formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials, isRoleDeniedError } from '../chunk-GOKAXJJS.js';
3
- export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-TUFSFAAI.js';
4
- import '../chunk-U5E4T4NS.js';
1
+ export { canAccess, checkAuth, createAuthClient, createAuthGuard, createAuthHook, createNavFilter, filterByAccess, filterNavSections, matchesRoute, protectedLoad, requireAuth, requirePermission, requireRole, routePatterns } from '../chunk-RKSETJ4V.js';
2
+ export { RoleDeniedError, formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials, isRoleDeniedError } from '../chunk-TUHQ4FHC.js';
3
+ export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-BK34CVH5.js';
4
+ import '../chunk-GRQL5FSH.js';
5
5
  export { initAuth, isInitialized } from '../chunk-EM7PUNZB.js';
@@ -1,4 +1,4 @@
1
- import { U as User, h as LoginResponse, j as LogoutResponse, k as RegisterResponse, M as MFASetupResponse, o as MFAStatus, l as Session, D as Device, m as ApiKey, s as LinkedAccount, t as SecurityEvent, q as UserPreferences, e as StorageAdapter, f as AuthState, A as AuthConfig } from '../types-CKcLRCI_.js';
1
+ import { U as User, D as Device, f as LoginResponse, m as SecurityEvent, n as Session, A as ApiKey, L as LinkedAccount, g as LogoutResponse, h as MFASetupResponse, i as MFAStatus, k as RegisterResponse, p as UserPreferences, o as StorageAdapter, b as AuthState, a as AuthConfig } from '../types-BRxyphcX.js';
2
2
 
3
3
  /**
4
4
  * User Fixtures
@@ -50,6 +50,8 @@ interface AuthConfig {
50
50
  * ```
51
51
  */
52
52
  onSessionExpired?: (currentPath: string) => void;
53
+ /** Request timeout in milliseconds (default: 30000) */
54
+ requestTimeout?: number;
53
55
  /** SSO configuration */
54
56
  sso?: SSOConfig;
55
57
  /**
@@ -318,4 +320,4 @@ interface ResetPasswordData {
318
320
  newPassword: string;
319
321
  }
320
322
 
321
- export { type AuthConfig as A, type CreateApiKeyRequest as C, type Device as D, type LoginCredentials as L, type MFASetupResponse as M, type Pagination as P, type RegisterData as R, type SSOConfig as S, type User as U, isInitialized as a, getDefaultStorage as b, getStorage as c, getFetch as d, type StorageAdapter as e, type AuthState as f, getConfig as g, type LoginResponse as h, initAuth as i, type LogoutResponse as j, type RegisterResponse as k, type Session as l, type ApiKey as m, type CreateApiKeyResponse as n, type MFAStatus as o, type MFAChallengeData as p, type UserPreferences as q, resetConfig as r, type LinkedAccount as s, type SecurityEvent as t, type ProfileUpdateData as u, type ChangePasswordData as v, type ResetPasswordData as w };
323
+ export { type ApiKey as A, type ChangePasswordData as C, type Device as D, type LinkedAccount as L, type MFAChallengeData as M, type Pagination as P, type RegisterData as R, type SSOConfig as S, type User as U, type AuthConfig as a, type AuthState as b, type CreateApiKeyRequest as c, type CreateApiKeyResponse as d, type LoginCredentials as e, type LoginResponse as f, type LogoutResponse as g, type MFASetupResponse as h, type MFAStatus as i, type ProfileUpdateData as j, type RegisterResponse as k, type ResetPasswordData as l, type SecurityEvent as m, type Session as n, type StorageAdapter as o, type UserPreferences as p, getConfig as q, getDefaultStorage as r, getFetch as s, getStorage as t, initAuth as u, isInitialized as v, resetConfig as w };
@@ -1,4 +1,4 @@
1
- import { L as LoginCredentials, h as LoginResponse, j as LogoutResponse, R as RegisterData, k as RegisterResponse, U as User, u as ProfileUpdateData, l as Session, m as ApiKey, C as CreateApiKeyRequest, n as CreateApiKeyResponse, o as MFAStatus, M as MFASetupResponse, p as MFAChallengeData, D as Device, q as UserPreferences, s as LinkedAccount, t as SecurityEvent, P as Pagination } from './types-CKcLRCI_.js';
1
+ import { e as LoginCredentials, f as LoginResponse, g as LogoutResponse, R as RegisterData, k as RegisterResponse, U as User, j as ProfileUpdateData, n as Session, A as ApiKey, c as CreateApiKeyRequest, d as CreateApiKeyResponse, i as MFAStatus, h as MFASetupResponse, M as MFAChallengeData, D as Device, p as UserPreferences, L as LinkedAccount, m as SecurityEvent, P as Pagination } from './types-BRxyphcX.js';
2
2
 
3
3
  /**
4
4
  * Auth Service
@@ -411,4 +411,4 @@ declare function formatUserRoles(user: User | null | undefined, options?: {
411
411
  capitalize?: boolean;
412
412
  }): string;
413
413
 
414
- export { AuthService as A, type LoginOptions as L, type MFAVerifyOptions as M, RoleDeniedError as R, authService as a, getUserInitials as b, getAvatarFallback as c, getUserEmail as d, getGreeting as e, formatUserRoles as f, getDisplayName as g, isRoleDeniedError as i };
414
+ export { AuthService as A, type LoginOptions as L, type MFAVerifyOptions as M, RoleDeniedError as R, authService as a, getDisplayName as b, getGreeting as c, getUserEmail as d, getUserInitials as e, formatUserRoles as f, getAvatarFallback as g, isRoleDeniedError as i };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/auth",
3
- "version": "0.1.52",
3
+ "version": "0.1.55",
4
4
  "description": "Authentication services and Svelte bindings for Classic Theme apps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,8 +31,9 @@
31
31
  "scripts": {
32
32
  "build": "tsup",
33
33
  "dev": "tsup --watch",
34
- "clean": "rm -rf dist",
35
- "typecheck": "tsc --noEmit"
34
+ "clean": "node ../../scripts/rm.mjs dist",
35
+ "typecheck": "tsc --noEmit",
36
+ "test": "vitest run"
36
37
  },
37
38
  "keywords": [
38
39
  "authentication",