@djangocfg/api 2.1.266 → 2.1.268
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 +2 -1
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +2 -1
- package/dist/auth.mjs.map +1 -1
- package/package.json +2 -2
- package/src/auth/hooks/useAutoAuth.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/api",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.268",
|
|
4
4
|
"description": "Auto-generated TypeScript API client with React hooks, SWR integration, and Zod validation for Django REST Framework backends",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"django",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/node": "^24.7.2",
|
|
86
86
|
"@types/react": "^19.1.0",
|
|
87
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
87
|
+
"@djangocfg/typescript-config": "^2.1.268",
|
|
88
88
|
"next": "^16.0.10",
|
|
89
89
|
"react": "^19.1.0",
|
|
90
90
|
"tsup": "^8.5.0",
|
|
@@ -43,11 +43,16 @@ export const useAutoAuth = (options: UseAutoAuthOptions = {}) => {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// Clean up URL to remove sensitive params for security
|
|
46
|
+
// Use window.location.pathname to preserve the locale prefix (e.g. /ru/auth)
|
|
47
|
+
// because usePathname() strips the locale, and router.push('/auth') would cause
|
|
48
|
+
// next-intl middleware to redirect back to /ru/auth — triggering a full page reload
|
|
49
|
+
// that loses the in-flight OTP submission.
|
|
46
50
|
if (cleanupUrl && queryOtp) {
|
|
47
51
|
const cleanQuery = Object.fromEntries(queryParams.entries());
|
|
48
52
|
delete cleanQuery.otp;
|
|
49
53
|
const queryString = new URLSearchParams(cleanQuery).toString();
|
|
50
|
-
|
|
54
|
+
const realPathname = typeof window !== 'undefined' ? window.location.pathname : pathname;
|
|
55
|
+
router.replace(queryString ? `${realPathname}?${queryString}` : realPathname);
|
|
51
56
|
}
|
|
52
57
|
}, [pathname, queryParams, onOTPDetected, cleanupUrl, router, isReady]);
|
|
53
58
|
|