@djangocfg/layouts 2.1.455 → 2.1.456
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/package.json +15 -15
- package/src/components/RedirectPage/RedirectPage.tsx +2 -1
- package/src/layouts/AuthLayout/components/oauth/OAuthCallback.tsx +2 -1
- package/src/layouts/PrivateLayout/hooks/useAuthGuard.ts +2 -1
- package/src/layouts/PublicLayout/components/UserMenu.tsx +2 -1
- package/src/layouts/PublicLayout/shared/MobileDrawerShell.tsx +2 -1
- package/src/snippets/AuthDialog/AuthDialog.tsx +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.456",
|
|
4
4
|
"description": "Simple, straightforward layout components for Next.js - import and use with props",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layouts",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"check": "tsc --noEmit"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
|
-
"@djangocfg/api": "^2.1.
|
|
93
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
94
|
-
"@djangocfg/debuger": "^2.1.
|
|
95
|
-
"@djangocfg/i18n": "^2.1.
|
|
96
|
-
"@djangocfg/monitor": "^2.1.
|
|
97
|
-
"@djangocfg/ui-core": "^2.1.
|
|
92
|
+
"@djangocfg/api": "^2.1.456",
|
|
93
|
+
"@djangocfg/centrifugo": "^2.1.456",
|
|
94
|
+
"@djangocfg/debuger": "^2.1.456",
|
|
95
|
+
"@djangocfg/i18n": "^2.1.456",
|
|
96
|
+
"@djangocfg/monitor": "^2.1.456",
|
|
97
|
+
"@djangocfg/ui-core": "^2.1.456",
|
|
98
98
|
"@hookform/resolvers": "^5.2.2",
|
|
99
99
|
"consola": "^3.4.2",
|
|
100
100
|
"lucide-react": "^0.545.0",
|
|
@@ -125,14 +125,14 @@
|
|
|
125
125
|
"uuid": "^11.1.0"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
|
-
"@djangocfg/api": "^2.1.
|
|
129
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
130
|
-
"@djangocfg/debuger": "^2.1.
|
|
131
|
-
"@djangocfg/i18n": "^2.1.
|
|
132
|
-
"@djangocfg/monitor": "^2.1.
|
|
133
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
134
|
-
"@djangocfg/ui-core": "^2.1.
|
|
135
|
-
"@djangocfg/ui-tools": "^2.1.
|
|
128
|
+
"@djangocfg/api": "^2.1.456",
|
|
129
|
+
"@djangocfg/centrifugo": "^2.1.456",
|
|
130
|
+
"@djangocfg/debuger": "^2.1.456",
|
|
131
|
+
"@djangocfg/i18n": "^2.1.456",
|
|
132
|
+
"@djangocfg/monitor": "^2.1.456",
|
|
133
|
+
"@djangocfg/typescript-config": "^2.1.456",
|
|
134
|
+
"@djangocfg/ui-core": "^2.1.456",
|
|
135
|
+
"@djangocfg/ui-tools": "^2.1.456",
|
|
136
136
|
"@types/node": "^25.2.3",
|
|
137
137
|
"@types/react": "^19.2.15",
|
|
138
138
|
"@types/react-dom": "^19.2.3",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { DEFAULT_AUTH_PATH } from '@djangocfg/api/auth';
|
|
2
3
|
|
|
3
4
|
import { useEffect } from 'react';
|
|
4
5
|
|
|
@@ -46,7 +47,7 @@ export interface RedirectPageProps {
|
|
|
46
47
|
*/
|
|
47
48
|
export function RedirectPage({
|
|
48
49
|
authenticatedPath = '/private',
|
|
49
|
-
unauthenticatedPath =
|
|
50
|
+
unauthenticatedPath = DEFAULT_AUTH_PATH,
|
|
50
51
|
loadingText = 'Loading...',
|
|
51
52
|
}: RedirectPageProps) {
|
|
52
53
|
const { isAuthenticated } = useAuth();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { DEFAULT_AUTH_PATH } from '@djangocfg/api/auth';
|
|
2
3
|
|
|
3
4
|
import { AlertCircle, Loader2 } from 'lucide-react';
|
|
4
5
|
import { useSearchParams } from 'next/navigation';
|
|
@@ -165,7 +166,7 @@ function OAuthCallbackRaw({
|
|
|
165
166
|
{status === 'error' && (
|
|
166
167
|
<CardContent className="text-center">
|
|
167
168
|
<a
|
|
168
|
-
href=
|
|
169
|
+
href={DEFAULT_AUTH_PATH}
|
|
169
170
|
className="text-primary hover:underline text-sm"
|
|
170
171
|
>
|
|
171
172
|
Try again
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
'use client';
|
|
8
|
+
import { DEFAULT_AUTH_PATH } from '@djangocfg/api/auth';
|
|
8
9
|
|
|
9
10
|
import { useEffect, useState } from 'react';
|
|
10
11
|
import { useRouter } from 'next/navigation';
|
|
@@ -39,7 +40,7 @@ interface UseAuthGuardResult {
|
|
|
39
40
|
|
|
40
41
|
export function useAuthGuard({
|
|
41
42
|
requireAuth = true,
|
|
42
|
-
authPath =
|
|
43
|
+
authPath = DEFAULT_AUTH_PATH,
|
|
43
44
|
loadingTimeoutMs = 8000,
|
|
44
45
|
}: UseAuthGuardOptions): UseAuthGuardResult {
|
|
45
46
|
const { isAuthenticated, isLoading: authLoading, saveRedirectUrl } = useAuth();
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
'use client';
|
|
32
|
+
import { DEFAULT_AUTH_PATH } from '@djangocfg/api/auth';
|
|
32
33
|
|
|
33
34
|
import { ArrowRight, Languages, LogOut } from 'lucide-react';
|
|
34
35
|
import { Link } from '@djangocfg/ui-core/components';
|
|
@@ -69,7 +70,7 @@ export interface UserMenuProps {
|
|
|
69
70
|
export function UserMenu({
|
|
70
71
|
variant = 'desktop',
|
|
71
72
|
groups,
|
|
72
|
-
authPath =
|
|
73
|
+
authPath = DEFAULT_AUTH_PATH,
|
|
73
74
|
disableAuth = false,
|
|
74
75
|
i18n,
|
|
75
76
|
}: UserMenuProps) {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use client';
|
|
9
|
+
import { DEFAULT_AUTH_PATH } from '@djangocfg/api/auth';
|
|
9
10
|
|
|
10
11
|
import { ArrowRight } from 'lucide-react';
|
|
11
12
|
import React, { useMemo } from 'react';
|
|
@@ -211,7 +212,7 @@ export function MobileDrawerShell(props: MobileDrawerShellProps) {
|
|
|
211
212
|
{showSignInFooter && (
|
|
212
213
|
<div className="shrink-0 border-t border-border/50 p-4">
|
|
213
214
|
<Link
|
|
214
|
-
href={userMenu?.authPath ||
|
|
215
|
+
href={userMenu?.authPath || DEFAULT_AUTH_PATH}
|
|
215
216
|
onClick={closeMobileMenu}
|
|
216
217
|
className="block"
|
|
217
218
|
>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { LogIn } from 'lucide-react';
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
|
|
6
|
-
import { useCfgRouter } from '@djangocfg/api/auth';
|
|
6
|
+
import { DEFAULT_AUTH_PATH, useAuth, useCfgRouter } from '@djangocfg/api/auth';
|
|
7
7
|
import { useAppT } from '@djangocfg/i18n';
|
|
8
8
|
import {
|
|
9
9
|
Button, Dialog, DialogContent, DialogHeader, DialogTitle
|
|
@@ -17,7 +17,7 @@ interface AuthDialogProps {
|
|
|
17
17
|
|
|
18
18
|
export const AuthDialog: React.FC<AuthDialogProps> = ({
|
|
19
19
|
onAuthRequired,
|
|
20
|
-
authPath =
|
|
20
|
+
authPath = DEFAULT_AUTH_PATH
|
|
21
21
|
}) => {
|
|
22
22
|
const open = useDialogStore((s) => s.authOpen);
|
|
23
23
|
const authOptions = useDialogStore((s) => s.authOptions);
|
|
@@ -32,15 +32,18 @@ export const AuthDialog: React.FC<AuthDialogProps> = ({
|
|
|
32
32
|
|
|
33
33
|
const message = authOptions?.message || labels.pleaseSignIn;
|
|
34
34
|
const router = useCfgRouter();
|
|
35
|
+
const { saveRedirectUrl } = useAuth();
|
|
35
36
|
|
|
36
37
|
const handleClose = () => {
|
|
37
38
|
resolveAuth(false);
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
const handleGoToAuth = () => {
|
|
42
|
+
// Canonical post-login redirect persistence (the same store the guard and
|
|
43
|
+
// verifyOTP read). The old private `redirectAfterAuth` sessionStorage key
|
|
44
|
+
// was write-only — nothing ever read it.
|
|
41
45
|
if (typeof window !== 'undefined') {
|
|
42
|
-
|
|
43
|
-
sessionStorage.setItem('redirectAfterAuth', redirect);
|
|
46
|
+
saveRedirectUrl(authOptions?.redirectUrl || window.location.pathname);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
if (onAuthRequired) {
|