@djangocfg/api 2.1.360 → 2.1.362
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 +1 -0
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +1 -0
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +1 -0
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.mjs +1 -0
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +1 -0
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.mjs +1 -0
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.mjs +1 -0
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/_cfg_accounts/openapi.json +1811 -0
- package/src/_api/generated/_cfg_centrifugo/openapi.json +132 -0
- package/src/_api/generated/_cfg_totp/openapi.json +927 -0
- package/src/_api/generated/helpers/auth.ts +13 -2
- package/src/_api/generated/openapi.json +2789 -0
|
@@ -79,7 +79,11 @@ function detectLocale(): string | null {
|
|
|
79
79
|
return null;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
/** Default baseUrl from `NEXT_PUBLIC_API_URL
|
|
82
|
+
/** Default baseUrl from `NEXT_PUBLIC_API_URL`.
|
|
83
|
+
*
|
|
84
|
+
* Both browser and server use NEXT_PUBLIC_API_URL — requests go
|
|
85
|
+
* directly to Django without Next.js proxy.
|
|
86
|
+
*/
|
|
83
87
|
function defaultBaseUrl(): string {
|
|
84
88
|
try {
|
|
85
89
|
if (typeof process !== 'undefined' && process.env) {
|
|
@@ -90,8 +94,15 @@ function defaultBaseUrl(): string {
|
|
|
90
94
|
return '';
|
|
91
95
|
}
|
|
92
96
|
|
|
93
|
-
/** Default API key fallback from `NEXT_PUBLIC_API_KEY`.
|
|
97
|
+
/** Default API key fallback from `NEXT_PUBLIC_API_KEY`.
|
|
98
|
+
*
|
|
99
|
+
* In the browser: returns null — requests go through the Next.js rewrite
|
|
100
|
+
* and the key is injected server-side (never exposed in the bundle).
|
|
101
|
+
* On the server: reads NEXT_PUBLIC_API_KEY as a fallback for SSR calls
|
|
102
|
+
* that bypass the rewrite (e.g. server components calling Django directly).
|
|
103
|
+
*/
|
|
94
104
|
function defaultApiKey(): string | null {
|
|
105
|
+
if (isBrowser) return null;
|
|
95
106
|
try {
|
|
96
107
|
if (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_API_KEY) {
|
|
97
108
|
return process.env.NEXT_PUBLIC_API_KEY;
|