@payez/next-mvp 3.9.1 → 4.0.0
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/api/auth-handler.d.ts +1 -2
- package/dist/api/auth-handler.js +9 -9
- package/dist/api-handlers/account/change-password.js +110 -112
- package/dist/api-handlers/admin/analytics.d.ts +19 -20
- package/dist/api-handlers/admin/analytics.js +378 -379
- package/dist/api-handlers/admin/audit.d.ts +19 -20
- package/dist/api-handlers/admin/audit.js +213 -214
- package/dist/api-handlers/admin/index.d.ts +21 -22
- package/dist/api-handlers/admin/index.js +42 -43
- package/dist/api-handlers/admin/redis-sessions.d.ts +35 -36
- package/dist/api-handlers/admin/redis-sessions.js +203 -204
- package/dist/api-handlers/admin/sessions.d.ts +20 -21
- package/dist/api-handlers/admin/sessions.js +283 -284
- package/dist/api-handlers/admin/site-logs.d.ts +45 -46
- package/dist/api-handlers/admin/site-logs.js +317 -318
- package/dist/api-handlers/admin/stats.d.ts +20 -21
- package/dist/api-handlers/admin/stats.js +239 -240
- package/dist/api-handlers/admin/users.d.ts +19 -20
- package/dist/api-handlers/admin/users.js +221 -222
- package/dist/api-handlers/admin/vibe-data.d.ts +79 -80
- package/dist/api-handlers/admin/vibe-data.js +267 -268
- package/dist/api-handlers/auth/refresh.js +633 -635
- package/dist/api-handlers/auth/signout.js +186 -187
- package/dist/api-handlers/auth/status.js +4 -7
- package/dist/api-handlers/auth/update-session.d.ts +1 -1
- package/dist/api-handlers/auth/update-session.js +12 -14
- package/dist/api-handlers/auth/verify-code.d.ts +43 -43
- package/dist/api-handlers/auth/verify-code.js +90 -94
- package/dist/api-handlers/session/viability.js +114 -146
- package/dist/api-handlers/test/force-expire.js +59 -65
- package/dist/auth/auth-decision.js +182 -182
- package/dist/auth/better-auth.d.ts +3 -6
- package/dist/auth/better-auth.js +3 -6
- package/dist/auth/route-config.js +2 -2
- package/dist/auth/utils/token-utils.d.ts +83 -84
- package/dist/auth/utils/token-utils.js +218 -219
- package/dist/client/AuthContext.js +115 -112
- package/dist/client/better-auth-client.d.ts +1020 -1020
- package/dist/client/fetch-with-auth.js +2 -2
- package/dist/components/SessionSync.js +121 -119
- package/dist/components/account/MobileNavDrawer.js +64 -64
- package/dist/components/account/UserAvatarMenu.js +91 -88
- package/dist/components/admin/VibeAdminLayout.js +71 -69
- package/dist/hooks/useAuth.js +9 -7
- package/dist/hooks/useAuthSettings.js +93 -93
- package/dist/hooks/useAvailableProviders.d.ts +43 -45
- package/dist/hooks/useAvailableProviders.js +112 -108
- package/dist/hooks/useSessionExpiration.d.ts +2 -3
- package/dist/hooks/useSessionExpiration.js +2 -2
- package/dist/hooks/useViabilitySession.js +3 -2
- package/dist/index.js +4 -6
- package/dist/lib/app-slug.d.ts +95 -95
- package/dist/lib/app-slug.js +172 -172
- package/dist/lib/standardized-client-api.js +10 -5
- package/dist/lib/startup-init.js +21 -25
- package/dist/lib/test-aware-get-token.js +86 -81
- package/dist/lib/token-lifecycle.d.ts +78 -52
- package/dist/lib/token-lifecycle.js +360 -398
- package/dist/pages/admin-login/page.js +73 -83
- package/dist/pages/client-admin/ClientSiteAdminPage.js +179 -177
- package/dist/pages/login/page.js +202 -211
- package/dist/pages/showcase/ShowcasePage.js +142 -140
- package/dist/pages/test-env/EmergencyLogoutPage.js +99 -98
- package/dist/pages/test-env/JwtInspectPage.js +116 -114
- package/dist/pages/test-env/RefreshTokenPage.js +4 -2
- package/dist/pages/test-env/TestEnvPage.js +51 -49
- package/dist/pages/verify-code/page.js +412 -408
- package/dist/routes/auth/logout.d.ts +31 -31
- package/dist/routes/auth/logout.js +98 -113
- package/dist/routes/auth/nextauth.d.ts +14 -11
- package/dist/routes/auth/nextauth.js +25 -57
- package/dist/routes/auth/session.js +157 -179
- package/dist/routes/auth/viability.js +190 -201
- package/dist/server/auth.d.ts +50 -0
- package/dist/server/auth.js +62 -0
- package/dist/stores/authStore.js +19 -23
- package/dist/utils/logout.js +5 -5
- package/package.json +1 -3
- package/src/api/auth-handler.ts +550 -549
- package/src/api-handlers/account/change-password.ts +5 -8
- package/src/api-handlers/admin/analytics.ts +4 -6
- package/src/api-handlers/admin/audit.ts +5 -7
- package/src/api-handlers/admin/index.ts +1 -2
- package/src/api-handlers/admin/redis-sessions.ts +6 -8
- package/src/api-handlers/admin/sessions.ts +5 -7
- package/src/api-handlers/admin/site-logs.ts +8 -10
- package/src/api-handlers/admin/stats.ts +4 -6
- package/src/api-handlers/admin/users.ts +5 -7
- package/src/api-handlers/admin/vibe-data.ts +10 -12
- package/src/api-handlers/auth/refresh.ts +5 -7
- package/src/api-handlers/auth/signout.ts +5 -6
- package/src/api-handlers/auth/status.ts +4 -7
- package/src/api-handlers/auth/update-session.ts +123 -125
- package/src/api-handlers/auth/verify-code.ts +9 -13
- package/src/api-handlers/session/viability.ts +10 -47
- package/src/api-handlers/test/force-expire.ts +4 -11
- package/src/auth/auth-decision.ts +1 -1
- package/src/auth/better-auth.ts +138 -141
- package/src/auth/route-config.ts +219 -219
- package/src/auth/utils/token-utils.ts +0 -1
- package/src/client/AuthContext.tsx +6 -2
- package/src/client/fetch-with-auth.ts +47 -47
- package/src/components/SessionSync.tsx +6 -5
- package/src/components/account/MobileNavDrawer.tsx +3 -3
- package/src/components/account/UserAvatarMenu.tsx +6 -3
- package/src/components/admin/VibeAdminLayout.tsx +4 -2
- package/src/config/logger.ts +1 -1
- package/src/hooks/useAuth.ts +117 -115
- package/src/hooks/useAuthSettings.ts +2 -2
- package/src/hooks/useAvailableProviders.ts +9 -5
- package/src/hooks/useSessionExpiration.ts +101 -102
- package/src/hooks/useViabilitySession.ts +336 -335
- package/src/index.ts +60 -63
- package/src/lib/api-handler.ts +0 -1
- package/src/lib/app-slug.ts +6 -6
- package/src/lib/standardized-client-api.ts +901 -895
- package/src/lib/startup-init.ts +243 -247
- package/src/lib/test-aware-get-token.ts +22 -12
- package/src/lib/token-lifecycle.ts +12 -53
- package/src/pages/admin-login/page.tsx +9 -17
- package/src/pages/client-admin/ClientSiteAdminPage.tsx +4 -2
- package/src/pages/login/page.tsx +21 -28
- package/src/pages/showcase/ShowcasePage.tsx +4 -2
- package/src/pages/test-env/EmergencyLogoutPage.tsx +7 -6
- package/src/pages/test-env/JwtInspectPage.tsx +5 -3
- package/src/pages/test-env/RefreshTokenPage.tsx +157 -155
- package/src/pages/test-env/TestEnvPage.tsx +4 -2
- package/src/pages/verify-code/page.tsx +10 -6
- package/src/routes/auth/logout.ts +7 -25
- package/src/routes/auth/nextauth.ts +45 -71
- package/src/routes/auth/session.ts +25 -50
- package/src/routes/auth/viability.ts +7 -19
- package/src/server/auth.ts +60 -0
- package/src/stores/authStore.ts +1899 -1904
- package/src/utils/logout.ts +30 -30
- package/src/auth/auth-options.ts +0 -237
- package/src/auth/callbacks/index.ts +0 -7
- package/src/auth/callbacks/jwt.ts +0 -382
- package/src/auth/callbacks/session.ts +0 -243
- package/src/auth/callbacks/signin.ts +0 -56
- package/src/auth/events/index.ts +0 -5
- package/src/auth/events/signout.ts +0 -33
- package/src/auth/providers/credentials.ts +0 -256
- package/src/auth/providers/index.ts +0 -6
- package/src/auth/providers/oauth.ts +0 -114
- package/src/lib/nextauth-secret.ts +0 -121
- package/src/types/next-auth.d.ts +0 -15
|
@@ -1,140 +1,142 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ShowcasePage = ShowcasePage;
|
|
8
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const link_1 = __importDefault(require("next/link"));
|
|
12
|
-
// Shared dark mode hook to avoid duplication
|
|
13
|
-
function useDarkMode() {
|
|
14
|
-
const [isDarkMode, setIsDarkMode] = (0,
|
|
15
|
-
(0,
|
|
16
|
-
const checkDarkMode = () => {
|
|
17
|
-
const isDark = document.documentElement.classList.contains('dark') ||
|
|
18
|
-
window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
-
setIsDarkMode(isDark);
|
|
20
|
-
};
|
|
21
|
-
checkDarkMode();
|
|
22
|
-
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
23
|
-
mediaQuery.addEventListener('change', checkDarkMode);
|
|
24
|
-
return () => mediaQuery.removeEventListener('change', checkDarkMode);
|
|
25
|
-
}, []);
|
|
26
|
-
return isDarkMode;
|
|
27
|
-
}
|
|
28
|
-
function FeatureCard({ title, description, status, link, children }) {
|
|
29
|
-
const isDarkMode = useDarkMode();
|
|
30
|
-
const content = ((0, jsx_runtime_1.jsxs)("div", { className: `p-6 rounded-lg h-full ${isDarkMode
|
|
31
|
-
? 'bg-slate-900 border border-slate-700'
|
|
32
|
-
: 'bg-white border border-gray-200'}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between mb-3", children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-semibold text-lg", children: title }), status === 'coming-soon' && ((0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded-full ${isDarkMode ? 'bg-amber-900/50 text-amber-400' : 'bg-amber-100 text-amber-700'}`, children: "Coming Soon" }))] }), (0, jsx_runtime_1.jsx)("p", { className: `text-sm mb-4 ${isDarkMode ? 'text-gray-400' : 'text-gray-600'}`, children: description }), children] }));
|
|
33
|
-
if (link && status === 'available') {
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)(link_1.default, { href: link, className: "block hover:opacity-90 transition-opacity", children: content }));
|
|
35
|
-
}
|
|
36
|
-
return content;
|
|
37
|
-
}
|
|
38
|
-
function DemoButton({ variant, children, onClick }) {
|
|
39
|
-
const variants = {
|
|
40
|
-
primary: 'bg-blue-600 hover:bg-blue-700 text-white',
|
|
41
|
-
secondary: 'bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-white',
|
|
42
|
-
danger: 'bg-red-600 hover:bg-red-700 text-white',
|
|
43
|
-
};
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)("button", { onClick: onClick, className: `px-4 py-2 rounded-lg text-sm font-medium transition-colors ${variants[variant]}`, children: children }));
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Feature Showcase Page
|
|
48
|
-
*
|
|
49
|
-
* Demonstrates MVP capabilities with interactive examples.
|
|
50
|
-
*
|
|
51
|
-
* Usage in consuming app:
|
|
52
|
-
* ```typescript
|
|
53
|
-
* // app/showcase/page.tsx
|
|
54
|
-
* export { ShowcasePage as default } from '@payez/next-mvp/pages/showcase';
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
function ShowcasePage() {
|
|
58
|
-
const { data:
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const [
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
//
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (status === '
|
|
125
|
-
return '
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ShowcasePage = ShowcasePage;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const better_auth_client_1 = require("../../client/better-auth-client");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const link_1 = __importDefault(require("next/link"));
|
|
12
|
+
// Shared dark mode hook to avoid duplication
|
|
13
|
+
function useDarkMode() {
|
|
14
|
+
const [isDarkMode, setIsDarkMode] = (0, react_1.useState)(false);
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
const checkDarkMode = () => {
|
|
17
|
+
const isDark = document.documentElement.classList.contains('dark') ||
|
|
18
|
+
window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
19
|
+
setIsDarkMode(isDark);
|
|
20
|
+
};
|
|
21
|
+
checkDarkMode();
|
|
22
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
23
|
+
mediaQuery.addEventListener('change', checkDarkMode);
|
|
24
|
+
return () => mediaQuery.removeEventListener('change', checkDarkMode);
|
|
25
|
+
}, []);
|
|
26
|
+
return isDarkMode;
|
|
27
|
+
}
|
|
28
|
+
function FeatureCard({ title, description, status, link, children }) {
|
|
29
|
+
const isDarkMode = useDarkMode();
|
|
30
|
+
const content = ((0, jsx_runtime_1.jsxs)("div", { className: `p-6 rounded-lg h-full ${isDarkMode
|
|
31
|
+
? 'bg-slate-900 border border-slate-700'
|
|
32
|
+
: 'bg-white border border-gray-200'}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-start justify-between mb-3", children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-semibold text-lg", children: title }), status === 'coming-soon' && ((0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded-full ${isDarkMode ? 'bg-amber-900/50 text-amber-400' : 'bg-amber-100 text-amber-700'}`, children: "Coming Soon" }))] }), (0, jsx_runtime_1.jsx)("p", { className: `text-sm mb-4 ${isDarkMode ? 'text-gray-400' : 'text-gray-600'}`, children: description }), children] }));
|
|
33
|
+
if (link && status === 'available') {
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(link_1.default, { href: link, className: "block hover:opacity-90 transition-opacity", children: content }));
|
|
35
|
+
}
|
|
36
|
+
return content;
|
|
37
|
+
}
|
|
38
|
+
function DemoButton({ variant, children, onClick }) {
|
|
39
|
+
const variants = {
|
|
40
|
+
primary: 'bg-blue-600 hover:bg-blue-700 text-white',
|
|
41
|
+
secondary: 'bg-gray-200 hover:bg-gray-300 text-gray-800 dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-white',
|
|
42
|
+
danger: 'bg-red-600 hover:bg-red-700 text-white',
|
|
43
|
+
};
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)("button", { onClick: onClick, className: `px-4 py-2 rounded-lg text-sm font-medium transition-colors ${variants[variant]}`, children: children }));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Feature Showcase Page
|
|
48
|
+
*
|
|
49
|
+
* Demonstrates MVP capabilities with interactive examples.
|
|
50
|
+
*
|
|
51
|
+
* Usage in consuming app:
|
|
52
|
+
* ```typescript
|
|
53
|
+
* // app/showcase/page.tsx
|
|
54
|
+
* export { ShowcasePage as default } from '@payez/next-mvp/pages/showcase';
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
function ShowcasePage() {
|
|
58
|
+
const { data: sessionData, isPending } = better_auth_client_1.authClient.useSession();
|
|
59
|
+
const session = sessionData;
|
|
60
|
+
const status = isPending ? 'loading' : session ? 'authenticated' : 'unauthenticated';
|
|
61
|
+
const isDarkMode = useDarkMode();
|
|
62
|
+
const [toastVisible, setToastVisible] = (0, react_1.useState)(false);
|
|
63
|
+
const [toastMessage, setToastMessage] = (0, react_1.useState)('');
|
|
64
|
+
const [modalVisible, setModalVisible] = (0, react_1.useState)(false);
|
|
65
|
+
const toastTimeoutRef = (0, react_1.useRef)(null);
|
|
66
|
+
const modalRef = (0, react_1.useRef)(null);
|
|
67
|
+
const previousFocusRef = (0, react_1.useRef)(null);
|
|
68
|
+
// Type the extended session properly
|
|
69
|
+
const extSession = session;
|
|
70
|
+
// Toast with proper cleanup to prevent race conditions
|
|
71
|
+
const showToast = (0, react_1.useCallback)((message) => {
|
|
72
|
+
if (toastTimeoutRef.current) {
|
|
73
|
+
clearTimeout(toastTimeoutRef.current);
|
|
74
|
+
}
|
|
75
|
+
setToastMessage(message);
|
|
76
|
+
setToastVisible(true);
|
|
77
|
+
toastTimeoutRef.current = setTimeout(() => setToastVisible(false), 3000);
|
|
78
|
+
}, []);
|
|
79
|
+
// Cleanup toast timeout on unmount
|
|
80
|
+
(0, react_1.useEffect)(() => {
|
|
81
|
+
return () => {
|
|
82
|
+
if (toastTimeoutRef.current) {
|
|
83
|
+
clearTimeout(toastTimeoutRef.current);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}, []);
|
|
87
|
+
// Modal focus trap and keyboard handling
|
|
88
|
+
(0, react_1.useEffect)(() => {
|
|
89
|
+
if (!modalVisible)
|
|
90
|
+
return;
|
|
91
|
+
// Store previous focus
|
|
92
|
+
previousFocusRef.current = document.activeElement;
|
|
93
|
+
// Focus the modal
|
|
94
|
+
modalRef.current?.focus();
|
|
95
|
+
// Handle Escape key
|
|
96
|
+
const handleKeyDown = (e) => {
|
|
97
|
+
if (e.key === 'Escape') {
|
|
98
|
+
setModalVisible(false);
|
|
99
|
+
}
|
|
100
|
+
// Focus trap
|
|
101
|
+
if (e.key === 'Tab' && modalRef.current) {
|
|
102
|
+
const focusableElements = modalRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
103
|
+
const firstElement = focusableElements[0];
|
|
104
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
105
|
+
if (e.shiftKey && document.activeElement === firstElement) {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
lastElement?.focus();
|
|
108
|
+
}
|
|
109
|
+
else if (!e.shiftKey && document.activeElement === lastElement) {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
firstElement?.focus();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
116
|
+
return () => {
|
|
117
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
118
|
+
// Restore focus when modal closes
|
|
119
|
+
previousFocusRef.current?.focus();
|
|
120
|
+
};
|
|
121
|
+
}, [modalVisible]);
|
|
122
|
+
// Get status text for screen readers
|
|
123
|
+
const getStatusText = () => {
|
|
124
|
+
if (status === 'authenticated')
|
|
125
|
+
return 'Authenticated';
|
|
126
|
+
if (status === 'loading')
|
|
127
|
+
return 'Loading';
|
|
128
|
+
return 'Not authenticated';
|
|
129
|
+
};
|
|
130
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `min-h-screen p-8 ${isDarkMode ? 'bg-slate-950 text-white' : 'bg-gray-50 text-gray-900'}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "max-w-6xl mx-auto", children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-8", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-3xl font-bold mb-2", children: "MVP Feature Showcase" }), (0, jsx_runtime_1.jsx)("p", { className: `${isDarkMode ? 'text-gray-400' : 'text-gray-600'}`, children: "Interactive demonstrations of @payez/next-mvp capabilities" })] }), (0, jsx_runtime_1.jsxs)("div", { className: `mb-8 p-4 rounded-lg flex items-center justify-between ${isDarkMode ? 'bg-slate-900 border border-slate-700' : 'bg-white border'}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: `w-3 h-3 rounded-full ${status === 'authenticated' ? 'bg-green-500' :
|
|
131
|
+
status === 'loading' ? 'bg-yellow-500' : 'bg-red-500'}`, "aria-hidden": "true" }), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: getStatusText() }), (0, jsx_runtime_1.jsx)("span", { className: "font-medium", children: status === 'authenticated' ? `Logged in as ${session?.user?.email}` :
|
|
132
|
+
status === 'loading' ? 'Loading session...' : 'Not authenticated' })] }), status === 'unauthenticated' && ((0, jsx_runtime_1.jsx)(link_1.default, { href: "/account-auth/login", className: "text-blue-500 hover:text-blue-600 text-sm font-medium", children: "Sign in to test authenticated features" }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8", children: [(0, jsx_runtime_1.jsx)(FeatureCard, { title: "Authentication", description: "Complete auth flow with traditional login, OAuth providers, and password recovery.", status: "available", link: "/account-auth/login", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "Email/Password" }), (0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "OAuth" }), (0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "2FA" })] }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Role-Based Access Control", description: "Fine-grained permissions with roles and access control configuration.", status: "available", children: (0, jsx_runtime_1.jsx)("div", { className: `text-xs p-3 rounded font-mono ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: extSession?.user?.roles ?
|
|
133
|
+
`Roles: ${extSession.user.roles.join(', ')}` :
|
|
134
|
+
'Sign in to view roles' }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Toast Notifications", description: "Non-blocking notifications for user feedback and status updates.", status: "available", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(DemoButton, { variant: "primary", onClick: () => showToast('Success! Action completed.'), children: "Success" }), (0, jsx_runtime_1.jsx)(DemoButton, { variant: "danger", onClick: () => showToast('Error! Something went wrong.'), children: "Error" })] }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Modal Dialogs", description: "Accessible modal dialogs for confirmations and focused interactions.", status: "available", children: (0, jsx_runtime_1.jsx)(DemoButton, { variant: "secondary", onClick: () => setModalVisible(true), children: "Open Modal" }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Form Validation", description: "Client and server-side validation with real-time feedback and error handling.", status: "available", link: "/account-auth/recovery", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "Real-time" }), (0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "Password Rules" })] }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Session Management", description: "JWT-based sessions with automatic refresh and secure token handling.", status: "available", link: "/test-env", children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1 text-xs", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { children: "Access Token:" }), (0, jsx_runtime_1.jsx)("span", { className: extSession?.accessToken ? 'text-green-500' : 'text-red-500', children: extSession?.accessToken ? 'Valid' : 'None' })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { children: "Refresh Token:" }), (0, jsx_runtime_1.jsx)("span", { className: extSession?.refreshToken ? 'text-green-500' : 'text-red-500', children: extSession?.refreshToken ? 'Valid' : 'None' })] })] }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "User Profile", description: "Profile management with avatar, display name, and account settings.", status: "available", link: "/profile", children: (0, jsx_runtime_1.jsxs)("div", { className: `flex items-center gap-3 p-2 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: [(0, jsx_runtime_1.jsx)("div", { className: "w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white font-medium", children: session?.user?.email?.charAt(0).toUpperCase() || '?' }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm truncate", children: session?.user?.email || 'Not signed in' })] }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Security Settings", description: "Password management, 2FA configuration, and active session control.", status: "available", link: "/security", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "Change Password" }), (0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "2FA Setup" })] }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Theme Support", description: "Light and dark mode with system preference detection and manual toggle.", status: "available", children: (0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-3", children: (0, jsx_runtime_1.jsxs)("div", { className: `px-3 py-2 rounded text-sm ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: ["Current: ", isDarkMode ? 'Dark' : 'Light'] }) }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Admin Panel", description: "Built-in admin interface for user management, roles, and system configuration.", status: "coming-soon", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "User Management" }), (0, jsx_runtime_1.jsx)("span", { className: `text-xs px-2 py-1 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "Schema Browser" })] }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "Data Tables", description: "Sortable, filterable, paginated tables with column customization.", status: "coming-soon", children: (0, jsx_runtime_1.jsx)("div", { className: `text-xs p-3 rounded ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "Sort, filter, paginate, export" }) }), (0, jsx_runtime_1.jsx)(FeatureCard, { title: "API Client", description: "Type-safe API client with automatic auth headers and error handling.", status: "available", children: (0, jsx_runtime_1.jsx)("div", { className: `text-xs p-3 rounded font-mono ${isDarkMode ? 'bg-slate-800' : 'bg-gray-100'}`, children: "fetchWithSession(url, options)" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: `p-6 rounded-lg ${isDarkMode ? 'bg-slate-900 border border-slate-700' : 'bg-white border'}`, children: [(0, jsx_runtime_1.jsx)("h2", { className: "font-semibold text-lg mb-4", children: "Quick Links" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap gap-3", children: [(0, jsx_runtime_1.jsx)(link_1.default, { href: "/test-env", className: `px-4 py-2 rounded-lg text-sm ${isDarkMode ? 'bg-slate-800 hover:bg-slate-700' : 'bg-gray-100 hover:bg-gray-200'}`, children: "Debug Tools" }), (0, jsx_runtime_1.jsx)(link_1.default, { href: "/test-env/jwt-inspect", className: `px-4 py-2 rounded-lg text-sm ${isDarkMode ? 'bg-slate-800 hover:bg-slate-700' : 'bg-gray-100 hover:bg-gray-200'}`, children: "JWT Inspector" }), (0, jsx_runtime_1.jsx)(link_1.default, { href: "/account-auth/login", className: `px-4 py-2 rounded-lg text-sm ${isDarkMode ? 'bg-slate-800 hover:bg-slate-700' : 'bg-gray-100 hover:bg-gray-200'}`, children: "Login Page" }), (0, jsx_runtime_1.jsx)(link_1.default, { href: "/profile", className: `px-4 py-2 rounded-lg text-sm ${isDarkMode ? 'bg-slate-800 hover:bg-slate-700' : 'bg-gray-100 hover:bg-gray-200'}`, children: "Profile" }), (0, jsx_runtime_1.jsx)(link_1.default, { href: "/security", className: `px-4 py-2 rounded-lg text-sm ${isDarkMode ? 'bg-slate-800 hover:bg-slate-700' : 'bg-gray-100 hover:bg-gray-200'}`, children: "Security Settings" })] })] })] }), toastVisible && ((0, jsx_runtime_1.jsx)("div", { role: "alert", "aria-live": "polite", className: `fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-lg transition-opacity ${isDarkMode ? 'bg-slate-800 text-white' : 'bg-gray-900 text-white'}`, children: toastMessage })), modalVisible && ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50", onClick: (e) => {
|
|
135
|
+
if (e.target === e.currentTarget)
|
|
136
|
+
setModalVisible(false);
|
|
137
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { ref: modalRef, role: "dialog", "aria-modal": "true", "aria-labelledby": "modal-title", tabIndex: -1, className: `max-w-md w-full p-6 rounded-lg ${isDarkMode ? 'bg-slate-900' : 'bg-white'}`, children: [(0, jsx_runtime_1.jsx)("h3", { id: "modal-title", className: "text-xl font-semibold mb-4", children: "Example Modal" }), (0, jsx_runtime_1.jsx)("p", { className: `mb-6 ${isDarkMode ? 'text-gray-400' : 'text-gray-600'}`, children: "This is a demonstration of an accessible modal dialog. Press Escape to close, or use Tab to navigate between buttons." }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-end gap-3", children: [(0, jsx_runtime_1.jsx)(DemoButton, { variant: "secondary", onClick: () => setModalVisible(false), children: "Cancel" }), (0, jsx_runtime_1.jsx)(DemoButton, { variant: "primary", onClick: () => {
|
|
138
|
+
setModalVisible(false);
|
|
139
|
+
showToast('Action confirmed!');
|
|
140
|
+
}, children: "Confirm" })] })] }) }))] }));
|
|
141
|
+
}
|
|
142
|
+
exports.default = ShowcasePage;
|
|
@@ -1,98 +1,99 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.EmergencyLogoutPage = EmergencyLogoutPage;
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
/**
|
|
9
|
-
* Emergency Logout Page
|
|
10
|
-
*
|
|
11
|
-
* Nuclear option for clearing auth state when things go wrong.
|
|
12
|
-
* Clears cookies, localStorage, and forces NextAuth signout.
|
|
13
|
-
*
|
|
14
|
-
* Usage in consuming app:
|
|
15
|
-
* ```typescript
|
|
16
|
-
* // app/test-env/emergency-logout/page.tsx
|
|
17
|
-
* export { EmergencyLogoutPage as default } from '@payez/next-mvp/pages/test-env';
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
function EmergencyLogoutPage() {
|
|
21
|
-
const {
|
|
22
|
-
const
|
|
23
|
-
const [
|
|
24
|
-
const [
|
|
25
|
-
const [
|
|
26
|
-
(0,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
mediaQuery.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
sessionStorage
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.EmergencyLogoutPage = EmergencyLogoutPage;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const better_auth_client_1 = require("../../client/better-auth-client");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* Emergency Logout Page
|
|
10
|
+
*
|
|
11
|
+
* Nuclear option for clearing auth state when things go wrong.
|
|
12
|
+
* Clears cookies, localStorage, and forces NextAuth signout.
|
|
13
|
+
*
|
|
14
|
+
* Usage in consuming app:
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // app/test-env/emergency-logout/page.tsx
|
|
17
|
+
* export { EmergencyLogoutPage as default } from '@payez/next-mvp/pages/test-env';
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
function EmergencyLogoutPage() {
|
|
21
|
+
const { data: sessionData, isPending } = better_auth_client_1.authClient.useSession();
|
|
22
|
+
const status = isPending ? 'loading' : sessionData ? 'authenticated' : 'unauthenticated';
|
|
23
|
+
const [isDarkMode, setIsDarkMode] = (0, react_1.useState)(false);
|
|
24
|
+
const [isLoggingOut, setIsLoggingOut] = (0, react_1.useState)(false);
|
|
25
|
+
const [logoutComplete, setLogoutComplete] = (0, react_1.useState)(false);
|
|
26
|
+
const [logs, setLogs] = (0, react_1.useState)([]);
|
|
27
|
+
(0, react_1.useEffect)(() => {
|
|
28
|
+
const checkDarkMode = () => {
|
|
29
|
+
const isDark = document.documentElement.classList.contains('dark') ||
|
|
30
|
+
window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
31
|
+
setIsDarkMode(isDark);
|
|
32
|
+
};
|
|
33
|
+
checkDarkMode();
|
|
34
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
35
|
+
mediaQuery.addEventListener('change', checkDarkMode);
|
|
36
|
+
return () => mediaQuery.removeEventListener('change', checkDarkMode);
|
|
37
|
+
}, []);
|
|
38
|
+
const addLog = (message) => {
|
|
39
|
+
setLogs(prev => [...prev, `[${new Date().toISOString().substring(11, 19)}] ${message}`]);
|
|
40
|
+
};
|
|
41
|
+
const handleEmergencyLogout = async () => {
|
|
42
|
+
setIsLoggingOut(true);
|
|
43
|
+
setLogs([]);
|
|
44
|
+
try {
|
|
45
|
+
// Step 1: Clear all cookies
|
|
46
|
+
addLog('Clearing cookies...');
|
|
47
|
+
document.cookie.split(';').forEach(cookie => {
|
|
48
|
+
const name = cookie.split('=')[0].trim();
|
|
49
|
+
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
|
|
50
|
+
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${window.location.hostname}`;
|
|
51
|
+
});
|
|
52
|
+
addLog('Cookies cleared');
|
|
53
|
+
// Step 2: Clear localStorage
|
|
54
|
+
addLog('Clearing localStorage...');
|
|
55
|
+
const keysToRemove = [];
|
|
56
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
57
|
+
const key = localStorage.key(i);
|
|
58
|
+
if (key)
|
|
59
|
+
keysToRemove.push(key);
|
|
60
|
+
}
|
|
61
|
+
keysToRemove.forEach(key => {
|
|
62
|
+
localStorage.removeItem(key);
|
|
63
|
+
addLog(` Removed: ${key}`);
|
|
64
|
+
});
|
|
65
|
+
addLog(`localStorage cleared (${keysToRemove.length} items)`);
|
|
66
|
+
// Step 3: Clear sessionStorage
|
|
67
|
+
addLog('Clearing sessionStorage...');
|
|
68
|
+
sessionStorage.clear();
|
|
69
|
+
addLog('sessionStorage cleared');
|
|
70
|
+
// Step 4: Call Better Auth signOut
|
|
71
|
+
addLog('Calling Better Auth signOut...');
|
|
72
|
+
await better_auth_client_1.authClient.signOut();
|
|
73
|
+
addLog('Better Auth signOut complete');
|
|
74
|
+
// Step 5: Clear any auth-related fetch cache
|
|
75
|
+
addLog('Invalidating caches...');
|
|
76
|
+
if ('caches' in window) {
|
|
77
|
+
const cacheNames = await caches.keys();
|
|
78
|
+
await Promise.all(cacheNames.map(name => caches.delete(name)));
|
|
79
|
+
addLog(`Cleared ${cacheNames.length} caches`);
|
|
80
|
+
}
|
|
81
|
+
addLog('Emergency logout complete!');
|
|
82
|
+
setLogoutComplete(true);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
addLog(`ERROR: ${error instanceof Error ? error.message : String(error)}`);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
setIsLoggingOut(false);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const handleRedirectHome = () => {
|
|
92
|
+
window.location.href = '/';
|
|
93
|
+
};
|
|
94
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `min-h-screen p-8 ${isDarkMode ? 'bg-slate-950 text-white' : 'bg-gray-50 text-gray-900'}`, children: (0, jsx_runtime_1.jsxs)("div", { className: "max-w-2xl mx-auto", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold mb-2", children: "Emergency Logout" }), (0, jsx_runtime_1.jsx)("p", { className: `mb-6 ${isDarkMode ? 'text-gray-400' : 'text-gray-600'}`, children: "Nuclear option for when auth gets into a bad state. Clears everything." }), (0, jsx_runtime_1.jsxs)("div", { className: `mb-6 p-4 rounded-lg ${isDarkMode ? 'bg-slate-900' : 'bg-white border'}`, children: [(0, jsx_runtime_1.jsx)("h2", { className: "font-semibold mb-2", children: "Current Status" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: `inline-block w-3 h-3 rounded-full ${status === 'authenticated' ? 'bg-green-500' :
|
|
95
|
+
status === 'loading' ? 'bg-yellow-500' : 'bg-red-500'}` }), (0, jsx_runtime_1.jsx)("span", { className: "capitalize", children: status })] })] }), !logoutComplete ? ((0, jsx_runtime_1.jsx)("button", { onClick: handleEmergencyLogout, disabled: isLoggingOut, className: `w-full py-3 px-4 rounded-lg font-semibold transition-colors ${isLoggingOut
|
|
96
|
+
? 'bg-gray-500 cursor-not-allowed'
|
|
97
|
+
: 'bg-red-600 hover:bg-red-700 text-white'}`, children: isLoggingOut ? 'Logging out...' : 'Emergency Logout' })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsx)("div", { className: `p-4 rounded-lg ${isDarkMode ? 'bg-green-900/30 border border-green-700' : 'bg-green-50 border border-green-200'}`, children: (0, jsx_runtime_1.jsx)("p", { className: `font-semibold ${isDarkMode ? 'text-green-400' : 'text-green-700'}`, children: "Logout complete! All auth state has been cleared." }) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleRedirectHome, className: "w-full py-3 px-4 rounded-lg font-semibold bg-blue-600 hover:bg-blue-700 text-white transition-colors", children: "Go to Home Page" })] })), logs.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: `mt-6 p-4 rounded-lg font-mono text-sm ${isDarkMode ? 'bg-slate-900' : 'bg-gray-100'}`, children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-semibold mb-2", children: "Log" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-1", children: logs.map((log, i) => ((0, jsx_runtime_1.jsx)("div", { className: log.includes('ERROR') ? 'text-red-500' : isDarkMode ? 'text-gray-300' : 'text-gray-700', children: log }, i))) })] })), (0, jsx_runtime_1.jsxs)("div", { className: `mt-8 p-4 rounded-lg ${isDarkMode ? 'bg-slate-900' : 'bg-white border'}`, children: [(0, jsx_runtime_1.jsx)("h2", { className: "font-semibold mb-2", children: "What this does" }), (0, jsx_runtime_1.jsxs)("ul", { className: `list-disc list-inside space-y-1 ${isDarkMode ? 'text-gray-400' : 'text-gray-600'}`, children: [(0, jsx_runtime_1.jsx)("li", { children: "Clears all browser cookies" }), (0, jsx_runtime_1.jsx)("li", { children: "Clears localStorage (theme, preferences, etc.)" }), (0, jsx_runtime_1.jsx)("li", { children: "Clears sessionStorage" }), (0, jsx_runtime_1.jsx)("li", { children: "Calls NextAuth signOut" }), (0, jsx_runtime_1.jsx)("li", { children: "Invalidates browser caches" })] })] })] }) }));
|
|
98
|
+
}
|
|
99
|
+
exports.default = EmergencyLogoutPage;
|