@classic-homes/auth 0.1.53 → 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.
- package/dist/{auth.svelte-JXZ7XEE5.js → auth.svelte-BBLX2MKB.js} +2 -2
- package/dist/{chunk-TUFSFAAI.js → chunk-BK34CVH5.js} +1 -1
- package/dist/{chunk-U5E4T4NS.js → chunk-GRQL5FSH.js} +43 -12
- package/dist/{chunk-RKHRCHOI.js → chunk-RKSETJ4V.js} +2 -2
- package/dist/{chunk-GOKAXJJS.js → chunk-TUHQ4FHC.js} +3 -3
- package/dist/core/index.d.ts +24 -5
- package/dist/core/index.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/svelte/index.d.ts +4 -4
- package/dist/svelte/index.js +4 -4
- package/dist/testing/index.d.ts +1 -1
- package/dist/{types-CKcLRCI_.d.ts → types-BRxyphcX.d.ts} +3 -1
- package/dist/{user-utils-Bi3-FHxY.d.ts → user-utils-BSbNN3Hb.d.ts} +2 -2
- package/package.json +4 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { authActions, authStore, currentUser, isAuthenticated } from './chunk-BK34CVH5.js';
|
|
2
|
+
import './chunk-GRQL5FSH.js';
|
|
3
3
|
import './chunk-EM7PUNZB.js';
|
|
@@ -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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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-
|
|
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
|
|
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(
|
|
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-
|
|
2
|
-
import { authStore, currentUser, isAuthenticated, authActions } from './chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
249
|
+
const { authStore } = await import('./auth.svelte-BBLX2MKB.js');
|
|
250
250
|
authStore.setAuth(
|
|
251
251
|
response.accessToken,
|
|
252
252
|
response.refreshToken,
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { A as AuthService, L as LoginOptions, M as MFAVerifyOptions, R as RoleDeniedError, a as authService, f as formatUserRoles,
|
|
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
|
-
*
|
|
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
|
*
|
package/dist/core/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } from '../chunk-
|
|
2
|
-
export { api, apiRequest, authApi, clearStoredAuth, extractData, getAccessToken, getRefreshToken, getSessionToken, updateStoredTokens } from '../chunk-
|
|
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 {
|
|
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,
|
|
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-
|
|
2
|
-
export { AuthService, RoleDeniedError, authService, formatUserRoles, getAvailableMethods, getAvatarFallback, getDisplayName, getGreeting, getMfaToken, getUserEmail, getUserInitials, isLoginSuccessResponse, isMfaChallengeResponse, isRoleDeniedError } 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 { 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';
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { a as authService } from '../user-utils-
|
|
4
|
-
export { R as RoleDeniedError, f as formatUserRoles,
|
|
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
|
package/dist/svelte/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-
|
|
2
|
-
export { RoleDeniedError, formatUserRoles, getAvatarFallback, getDisplayName, getGreeting, getUserEmail, getUserInitials, isRoleDeniedError } from '../chunk-
|
|
3
|
-
export { authActions, authStore, currentUser, isAuthenticated } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
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';
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as User,
|
|
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
|
|
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 {
|
|
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,
|
|
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.
|
|
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
|
|
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",
|