@djangocfg/api 2.1.101 → 2.1.102
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.cjs +6 -2
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +3 -1
- package/dist/auth.d.ts +3 -1
- package/dist/auth.mjs +6 -2
- package/dist/auth.mjs.map +1 -1
- package/package.json +3 -3
- package/src/auth/context/AuthContext.tsx +8 -2
- package/src/auth/context/types.ts +1 -1
package/dist/auth.d.cts
CHANGED
|
@@ -295,7 +295,9 @@ interface AuthContextType {
|
|
|
295
295
|
success: boolean;
|
|
296
296
|
message: string;
|
|
297
297
|
}>;
|
|
298
|
-
logout: (
|
|
298
|
+
logout: (options?: {
|
|
299
|
+
skipConfirm?: boolean;
|
|
300
|
+
}) => Promise<void>;
|
|
299
301
|
saveRedirectUrl: (url: string) => void;
|
|
300
302
|
getRedirectUrl: () => string;
|
|
301
303
|
clearRedirectUrl: () => void;
|
package/dist/auth.d.ts
CHANGED
|
@@ -295,7 +295,9 @@ interface AuthContextType {
|
|
|
295
295
|
success: boolean;
|
|
296
296
|
message: string;
|
|
297
297
|
}>;
|
|
298
|
-
logout: (
|
|
298
|
+
logout: (options?: {
|
|
299
|
+
skipConfirm?: boolean;
|
|
300
|
+
}) => Promise<void>;
|
|
299
301
|
saveRedirectUrl: (url: string) => void;
|
|
300
302
|
getRedirectUrl: () => string;
|
|
301
303
|
clearRedirectUrl: () => void;
|
package/dist/auth.mjs
CHANGED
|
@@ -4649,7 +4649,7 @@ var AuthProviderInternal = /* @__PURE__ */ __name(({ children, config }) => {
|
|
|
4649
4649
|
};
|
|
4650
4650
|
}
|
|
4651
4651
|
}, [clearAuthState, accounts]);
|
|
4652
|
-
const logout = useCallback3(async () => {
|
|
4652
|
+
const logout = useCallback3(async (options) => {
|
|
4653
4653
|
const performLogout = /* @__PURE__ */ __name(() => {
|
|
4654
4654
|
Analytics.event("auth_logout" /* AUTH_LOGOUT */, {
|
|
4655
4655
|
category: "auth" /* AUTH */
|
|
@@ -4660,6 +4660,10 @@ var AuthProviderInternal = /* @__PURE__ */ __name(({ children, config }) => {
|
|
|
4660
4660
|
const authCallbackUrl = config?.routes?.defaultAuthCallback || defaultRoutes.defaultAuthCallback;
|
|
4661
4661
|
router.hardReplace(authCallbackUrl);
|
|
4662
4662
|
}, "performLogout");
|
|
4663
|
+
if (options?.skipConfirm) {
|
|
4664
|
+
performLogout();
|
|
4665
|
+
return;
|
|
4666
|
+
}
|
|
4663
4667
|
if (configRef.current?.onConfirm) {
|
|
4664
4668
|
const { confirmed } = await configRef.current.onConfirm({
|
|
4665
4669
|
title: "Logout",
|
|
@@ -4788,7 +4792,7 @@ var defaultAuthState = {
|
|
|
4788
4792
|
authLogger.warn("useAuth: refreshToken called outside AuthProvider");
|
|
4789
4793
|
return { success: false, message: "AuthProvider not available" };
|
|
4790
4794
|
}, "refreshToken"),
|
|
4791
|
-
logout: /* @__PURE__ */ __name(async () => {
|
|
4795
|
+
logout: /* @__PURE__ */ __name(async (_options) => {
|
|
4792
4796
|
authLogger.warn("useAuth: logout called outside AuthProvider");
|
|
4793
4797
|
}, "logout"),
|
|
4794
4798
|
saveRedirectUrl: /* @__PURE__ */ __name(() => {
|