@djangocfg/api 2.1.86 → 2.1.88
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-server.cjs +1948 -4
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.d.cts +35 -1
- package/dist/auth-server.d.ts +35 -1
- package/dist/auth-server.mjs +1938 -4
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +237 -112
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +17 -1
- package/dist/auth.d.ts +17 -1
- package/dist/auth.mjs +200 -75
- package/dist/auth.mjs.map +1 -1
- package/package.json +3 -3
- package/src/auth/context/AuthContext.tsx +56 -10
- package/src/auth/hooks/index.ts +3 -0
- package/src/auth/hooks/useProfileCache.ts +1 -1
- package/src/auth/hooks/useTokenRefresh.ts +167 -0
- package/src/auth/middlewares/index.ts +8 -1
- package/src/auth/middlewares/tokenRefresh.ts +169 -0
package/dist/auth.d.cts
CHANGED
|
@@ -829,6 +829,22 @@ declare function getCacheMetadata(): {
|
|
|
829
829
|
expiresIn?: number;
|
|
830
830
|
} | null;
|
|
831
831
|
|
|
832
|
+
interface UseTokenRefreshOptions {
|
|
833
|
+
/** Enable automatic token refresh (default: true) */
|
|
834
|
+
enabled?: boolean;
|
|
835
|
+
/** Callback when token is refreshed */
|
|
836
|
+
onRefresh?: (newToken: string) => void;
|
|
837
|
+
/** Callback when refresh fails */
|
|
838
|
+
onRefreshError?: (error: Error) => void;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Hook for automatic token refresh
|
|
842
|
+
*/
|
|
843
|
+
declare function useTokenRefresh(options?: UseTokenRefreshOptions): {
|
|
844
|
+
refreshToken: () => Promise<boolean>;
|
|
845
|
+
checkAndRefresh: () => Promise<void>;
|
|
846
|
+
};
|
|
847
|
+
|
|
832
848
|
/**
|
|
833
849
|
* Email validation utility
|
|
834
850
|
*/
|
|
@@ -888,4 +904,4 @@ declare const Analytics: {
|
|
|
888
904
|
setUser(userId: string): void;
|
|
889
905
|
};
|
|
890
906
|
|
|
891
|
-
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthChannel, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormContextType, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, type AuthHelpProps, type AuthLayoutConfig, type AuthLayoutProps, AuthProvider, type AuthProviderProps, type AuthStep, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, detectChannelFromIdentifier, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useGithubAuth, useLocalStorage, useSessionStorage, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|
|
907
|
+
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthChannel, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormContextType, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, type AuthHelpProps, type AuthLayoutConfig, type AuthLayoutProps, AuthProvider, type AuthProviderProps, type AuthStep, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, detectChannelFromIdentifier, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useGithubAuth, useLocalStorage, useSessionStorage, useTokenRefresh, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|
package/dist/auth.d.ts
CHANGED
|
@@ -829,6 +829,22 @@ declare function getCacheMetadata(): {
|
|
|
829
829
|
expiresIn?: number;
|
|
830
830
|
} | null;
|
|
831
831
|
|
|
832
|
+
interface UseTokenRefreshOptions {
|
|
833
|
+
/** Enable automatic token refresh (default: true) */
|
|
834
|
+
enabled?: boolean;
|
|
835
|
+
/** Callback when token is refreshed */
|
|
836
|
+
onRefresh?: (newToken: string) => void;
|
|
837
|
+
/** Callback when refresh fails */
|
|
838
|
+
onRefreshError?: (error: Error) => void;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Hook for automatic token refresh
|
|
842
|
+
*/
|
|
843
|
+
declare function useTokenRefresh(options?: UseTokenRefreshOptions): {
|
|
844
|
+
refreshToken: () => Promise<boolean>;
|
|
845
|
+
checkAndRefresh: () => Promise<void>;
|
|
846
|
+
};
|
|
847
|
+
|
|
832
848
|
/**
|
|
833
849
|
* Email validation utility
|
|
834
850
|
*/
|
|
@@ -888,4 +904,4 @@ declare const Analytics: {
|
|
|
888
904
|
setUser(userId: string): void;
|
|
889
905
|
};
|
|
890
906
|
|
|
891
|
-
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthChannel, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormContextType, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, type AuthHelpProps, type AuthLayoutConfig, type AuthLayoutProps, AuthProvider, type AuthProviderProps, type AuthStep, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, detectChannelFromIdentifier, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useGithubAuth, useLocalStorage, useSessionStorage, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|
|
907
|
+
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthChannel, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormContextType, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, type AuthHelpProps, type AuthLayoutConfig, type AuthLayoutProps, AuthProvider, type AuthProviderProps, type AuthStep, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, detectChannelFromIdentifier, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useGithubAuth, useLocalStorage, useSessionStorage, useTokenRefresh, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|