@payloadcms/next 3.68.0-internal-debug.591ab42 → 3.68.0-internal-debug.e9b66ee
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/elements/DocumentHeader/Tabs/Tab/TabLink.js +6 -21
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +20 -44
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +41 -73
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +1 -10
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -1
- package/dist/elements/DocumentHeader/index.js +7 -45
- package/dist/elements/DocumentHeader/index.js.map +1 -1
- package/dist/elements/FormHeader/index.js +4 -25
- package/dist/elements/FormHeader/index.js.map +1 -1
- package/dist/elements/Nav/NavHamburger/index.js +5 -21
- package/dist/elements/Nav/NavHamburger/index.js.map +1 -1
- package/dist/elements/Nav/NavWrapper/index.js +10 -24
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -1
- package/dist/elements/Nav/SettingsMenuButton/index.js +4 -27
- package/dist/elements/Nav/SettingsMenuButton/index.js.map +1 -1
- package/dist/elements/Nav/index.client.js +43 -91
- package/dist/elements/Nav/index.client.js.map +1 -1
- package/dist/elements/Nav/index.js +48 -100
- package/dist/elements/Nav/index.js.map +1 -1
- package/dist/layouts/Root/NestProviders.js +3 -12
- package/dist/layouts/Root/NestProviders.js.map +1 -1
- package/dist/layouts/Root/index.js +19 -84
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +5 -0
- package/dist/routes/rest/og/image.js +61 -97
- package/dist/routes/rest/og/image.js.map +1 -1
- package/dist/routes/rest/og/index.js +1 -15
- package/dist/routes/rest/og/index.js.map +1 -1
- package/dist/templates/Default/NavHamburger/index.js +1 -10
- package/dist/templates/Default/NavHamburger/index.js.map +1 -1
- package/dist/templates/Default/Wrapper/index.js +9 -16
- package/dist/templates/Default/Wrapper/index.js.map +1 -1
- package/dist/templates/Default/index.js +38 -106
- package/dist/templates/Default/index.js.map +1 -1
- package/dist/templates/Minimal/index.js +3 -18
- package/dist/templates/Minimal/index.js.map +1 -1
- package/dist/views/API/LocaleSelector/index.js +5 -15
- package/dist/views/API/LocaleSelector/index.js.map +1 -1
- package/dist/views/API/RenderJSON/index.js +59 -156
- package/dist/views/API/RenderJSON/index.js.map +1 -1
- package/dist/views/API/index.client.js +71 -215
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/API/index.js +1 -7
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/Account/ResetPreferences/index.js +8 -35
- package/dist/views/Account/ResetPreferences/index.js.map +1 -1
- package/dist/views/Account/Settings/LanguageSelector.js +3 -15
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -1
- package/dist/views/Account/Settings/index.js +12 -58
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +19 -30
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Account/index.js +25 -83
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/BrowseByFolder/buildView.js +28 -38
- package/dist/views/BrowseByFolder/buildView.js.map +1 -1
- package/dist/views/CollectionFolders/buildView.js +35 -45
- package/dist/views/CollectionFolders/buildView.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +20 -75
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.js +5 -36
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/Dashboard/Default/index.js +94 -169
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/index.js +24 -43
- package/dist/views/Dashboard/index.js.map +1 -1
- package/dist/views/Document/index.js +14 -76
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Edit/index.js +1 -9
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +57 -104
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/ForgotPassword/index.js +23 -75
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/List/index.js +31 -53
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/renderListViewSlots.js +9 -21
- package/dist/views/List/renderListViewSlots.js.map +1 -1
- package/dist/views/Login/LoginField/index.js +23 -49
- package/dist/views/Login/LoginField/index.js.map +1 -1
- package/dist/views/Login/LoginForm/index.js +20 -68
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/index.js +33 -66
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Logout/LogoutClient.js +7 -36
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.js +4 -26
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/NotFound/index.client.js +15 -55
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.js +5 -33
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/ResetPassword/ResetPasswordForm/index.js +12 -57
- package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -1
- package/dist/views/ResetPassword/index.js +23 -86
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/Root/index.js +12 -52
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Unauthorized/index.js +15 -50
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Verify/index.js +10 -47
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Version/Default/SelectedLocalesContext.js +1 -1
- package/dist/views/Version/Default/SelectedLocalesContext.js.map +1 -1
- package/dist/views/Version/Default/index.js +52 -258
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +16 -65
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js +24 -66
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js +5 -34
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js +4 -17
- package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js +10 -55
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +43 -128
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +23 -151
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js +3 -16
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +4 -17
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +51 -122
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +4 -17
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js +27 -176
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +1 -9
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/Restore/index.js +21 -61
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js +16 -24
- package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js +6 -37
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +10 -40
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +17 -33
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Version/VersionPillLabel/VersionPillLabel.js +17 -84
- package/dist/views/Version/VersionPillLabel/VersionPillLabel.js.map +1 -1
- package/dist/views/Version/index.js +21 -63
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Versions/buildColumns.js +9 -58
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +4 -31
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +7 -15
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +2 -9
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/index.client.js +20 -98
- package/dist/views/Versions/index.client.js.map +1 -1
- package/dist/views/Versions/index.js +13 -59
- package/dist/views/Versions/index.js.map +1 -1
- package/package.json +10 -9
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
3
2
|
import { Button, LoadingOverlay, toast, useAuth, useRouteTransition, useTranslation } from '@payloadcms/ui';
|
|
4
3
|
import { useRouter } from 'next/navigation.js';
|
|
5
4
|
import { formatAdminURL } from 'payload/shared';
|
|
@@ -62,42 +61,14 @@ const baseClass = 'logout';
|
|
|
62
61
|
inactivity
|
|
63
62
|
]);
|
|
64
63
|
if (!isLoggedIn && inactivity) {
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
fileName: "src/views/Logout/LogoutClient.tsx",
|
|
72
|
-
lineNumber: 80,
|
|
73
|
-
columnNumber: 9
|
|
74
|
-
}, this),
|
|
75
|
-
/*#__PURE__*/ _jsxDEV(Button, {
|
|
76
|
-
buttonStyle: "secondary",
|
|
77
|
-
el: "link",
|
|
78
|
-
size: "large",
|
|
79
|
-
url: loginRoute,
|
|
80
|
-
children: t('authentication:logBackIn')
|
|
81
|
-
}, void 0, false, {
|
|
82
|
-
fileName: "src/views/Logout/LogoutClient.tsx",
|
|
83
|
-
lineNumber: 81,
|
|
84
|
-
columnNumber: 9
|
|
85
|
-
}, this)
|
|
86
|
-
]
|
|
87
|
-
}, void 0, true, {
|
|
88
|
-
fileName: "src/views/Logout/LogoutClient.tsx",
|
|
89
|
-
lineNumber: 79,
|
|
90
|
-
columnNumber: 7
|
|
91
|
-
}, this);
|
|
64
|
+
return <div className={`${baseClass}__wrap`}>
|
|
65
|
+
<h2>{t('authentication:loggedOutInactivity')}</h2>
|
|
66
|
+
<Button buttonStyle="secondary" el="link" size="large" url={loginRoute}>
|
|
67
|
+
{t('authentication:logBackIn')}
|
|
68
|
+
</Button>
|
|
69
|
+
</div>;
|
|
92
70
|
}
|
|
93
|
-
return
|
|
94
|
-
animationDuration: '0ms',
|
|
95
|
-
loadingText: t('authentication:loggingOut')
|
|
96
|
-
}, void 0, false, {
|
|
97
|
-
fileName: "src/views/Logout/LogoutClient.tsx",
|
|
98
|
-
lineNumber: 88,
|
|
99
|
-
columnNumber: 10
|
|
100
|
-
}, this);
|
|
71
|
+
return <LoadingOverlay animationDuration={'0ms'} loadingText={t('authentication:loggingOut')}/>;
|
|
101
72
|
};
|
|
102
73
|
|
|
103
74
|
//# sourceMappingURL=LogoutClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/Logout/LogoutClient.tsx"],"sourcesContent":["'use client'\nimport {\n Button,\n LoadingOverlay,\n toast,\n useAuth,\n useRouteTransition,\n useTranslation,\n} from '@payloadcms/ui'\nimport { useRouter } from 'next/navigation.js'\nimport { formatAdminURL } from 'payload/shared'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'logout'\n\n/**\n * This component should **just** be the inactivity route and do nothing with logging the user out.\n *\n * It currently handles too much, the auth provider should just log the user out and then\n * we could remove the useEffect in this file. So instead of the logout button\n * being an anchor link, it should be a button that calls `logOut` in the provider.\n *\n * This view is still useful if cookies attempt to refresh and fail, i.e. the user\n * is logged out due to inactivity.\n */\nexport const LogoutClient: React.FC<{\n adminRoute: string\n inactivity?: boolean\n redirect: string\n}> = (props) => {\n const { adminRoute, inactivity, redirect } = props\n\n const { logOut, user } = useAuth()\n\n const { startRouteTransition } = useRouteTransition()\n\n const isLoggedIn = React.useMemo(() => {\n return Boolean(user?.id)\n }, [user?.id])\n\n const navigatingToLoginRef = React.useRef(false)\n\n const [loginRoute] = React.useState(() =>\n formatAdminURL({\n adminRoute,\n path: `/login${inactivity && redirect && redirect.length > 0\n ? `?redirect=${encodeURIComponent(redirect)}`\n : ''\n }`,\n }),\n )\n\n const { t } = useTranslation()\n const router = useRouter()\n\n const handleLogOut = React.useCallback(async () => {\n if (!navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n await logOut()\n toast.success(t('authentication:loggedOutSuccessfully'))\n startRouteTransition(() => router.push(loginRoute))\n return\n }\n }, [logOut, loginRoute, router, startRouteTransition, t])\n\n useEffect(() => {\n if (isLoggedIn && !inactivity) {\n void handleLogOut()\n } else if (!navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n startRouteTransition(() => router.push(loginRoute))\n }\n }, [handleLogOut, isLoggedIn, loginRoute, router, startRouteTransition, inactivity])\n\n if (!isLoggedIn && inactivity) {\n return (\n <div className={`${baseClass}__wrap`}>\n <h2>{t('authentication:loggedOutInactivity')}</h2>\n <Button buttonStyle=\"secondary\" el=\"link\" size=\"large\" url={loginRoute}>\n {t('authentication:logBackIn')}\n </Button>\n </div>\n )\n }\n\n return <LoadingOverlay animationDuration={'0ms'} loadingText={t('authentication:loggingOut')} />\n}\n"],"names":["Button","LoadingOverlay","toast","useAuth","useRouteTransition","useTranslation","useRouter","formatAdminURL","React","useEffect","baseClass","LogoutClient","props","adminRoute","inactivity","redirect","logOut","user","startRouteTransition","isLoggedIn","useMemo","Boolean","id","navigatingToLoginRef","useRef","loginRoute","useState","path","length","encodeURIComponent","t","router","handleLogOut","useCallback","current","success","push","div","className","h2","buttonStyle","el","size","url","animationDuration","loadingText"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../../src/views/Logout/LogoutClient.tsx"],"sourcesContent":["'use client'\nimport {\n Button,\n LoadingOverlay,\n toast,\n useAuth,\n useRouteTransition,\n useTranslation,\n} from '@payloadcms/ui'\nimport { useRouter } from 'next/navigation.js'\nimport { formatAdminURL } from 'payload/shared'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'logout'\n\n/**\n * This component should **just** be the inactivity route and do nothing with logging the user out.\n *\n * It currently handles too much, the auth provider should just log the user out and then\n * we could remove the useEffect in this file. So instead of the logout button\n * being an anchor link, it should be a button that calls `logOut` in the provider.\n *\n * This view is still useful if cookies attempt to refresh and fail, i.e. the user\n * is logged out due to inactivity.\n */\nexport const LogoutClient: React.FC<{\n adminRoute: string\n inactivity?: boolean\n redirect: string\n}> = (props) => {\n const { adminRoute, inactivity, redirect } = props\n\n const { logOut, user } = useAuth()\n\n const { startRouteTransition } = useRouteTransition()\n\n const isLoggedIn = React.useMemo(() => {\n return Boolean(user?.id)\n }, [user?.id])\n\n const navigatingToLoginRef = React.useRef(false)\n\n const [loginRoute] = React.useState(() =>\n formatAdminURL({\n adminRoute,\n path: `/login${inactivity && redirect && redirect.length > 0\n ? `?redirect=${encodeURIComponent(redirect)}`\n : ''\n }`,\n }),\n )\n\n const { t } = useTranslation()\n const router = useRouter()\n\n const handleLogOut = React.useCallback(async () => {\n if (!navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n await logOut()\n toast.success(t('authentication:loggedOutSuccessfully'))\n startRouteTransition(() => router.push(loginRoute))\n return\n }\n }, [logOut, loginRoute, router, startRouteTransition, t])\n\n useEffect(() => {\n if (isLoggedIn && !inactivity) {\n void handleLogOut()\n } else if (!navigatingToLoginRef.current) {\n navigatingToLoginRef.current = true\n startRouteTransition(() => router.push(loginRoute))\n }\n }, [handleLogOut, isLoggedIn, loginRoute, router, startRouteTransition, inactivity])\n\n if (!isLoggedIn && inactivity) {\n return (\n <div className={`${baseClass}__wrap`}>\n <h2>{t('authentication:loggedOutInactivity')}</h2>\n <Button buttonStyle=\"secondary\" el=\"link\" size=\"large\" url={loginRoute}>\n {t('authentication:logBackIn')}\n </Button>\n </div>\n )\n }\n\n return <LoadingOverlay animationDuration={'0ms'} loadingText={t('authentication:loggingOut')} />\n}\n"],"names":["Button","LoadingOverlay","toast","useAuth","useRouteTransition","useTranslation","useRouter","formatAdminURL","React","useEffect","baseClass","LogoutClient","props","adminRoute","inactivity","redirect","logOut","user","startRouteTransition","isLoggedIn","useMemo","Boolean","id","navigatingToLoginRef","useRef","loginRoute","useState","path","length","encodeURIComponent","t","router","handleLogOut","useCallback","current","success","push","div","className","h2","buttonStyle","el","size","url","animationDuration","loadingText"],"mappings":"AAAA;AACA,SACEA,MAAM,EACNC,cAAc,EACdC,KAAK,EACLC,OAAO,EACPC,kBAAkB,EAClBC,cAAc,QACT,iBAAgB;AACvB,SAASC,SAAS,QAAQ,qBAAoB;AAC9C,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,SAASC,SAAS,QAAQ,QAAO;AAExC,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB;;;;;;;;;CASC,GACD,OAAO,MAAMC,eAIR,CAACC;IACJ,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGH;IAE7C,MAAM,EAAEI,MAAM,EAAEC,IAAI,EAAE,GAAGd;IAEzB,MAAM,EAAEe,oBAAoB,EAAE,GAAGd;IAEjC,MAAMe,aAAaX,MAAMY,OAAO,CAAC;QAC/B,OAAOC,QAAQJ,MAAMK;IACvB,GAAG;QAACL,MAAMK;KAAG;IAEb,MAAMC,uBAAuBf,MAAMgB,MAAM,CAAC;IAE1C,MAAM,CAACC,WAAW,GAAGjB,MAAMkB,QAAQ,CAAC,IAClCnB,eAAe;YACbM;YACAc,MAAM,CAAC,MAAM,EAAEb,cAAcC,YAAYA,SAASa,MAAM,GAAG,IACrD,CAAC,UAAU,EAAEC,mBAAmBd,WAAW,GAC3C,IACF;QACN;IAGF,MAAM,EAAEe,CAAC,EAAE,GAAGzB;IACd,MAAM0B,SAASzB;IAEf,MAAM0B,eAAexB,MAAMyB,WAAW,CAAC;QACrC,IAAI,CAACV,qBAAqBW,OAAO,EAAE;YACjCX,qBAAqBW,OAAO,GAAG;YAC/B,MAAMlB;YACNd,MAAMiC,OAAO,CAACL,EAAE;YAChBZ,qBAAqB,IAAMa,OAAOK,IAAI,CAACX;YACvC;QACF;IACF,GAAG;QAACT;QAAQS;QAAYM;QAAQb;QAAsBY;KAAE;IAExDrB,UAAU;QACR,IAAIU,cAAc,CAACL,YAAY;YAC7B,KAAKkB;QACP,OAAO,IAAI,CAACT,qBAAqBW,OAAO,EAAE;YACxCX,qBAAqBW,OAAO,GAAG;YAC/BhB,qBAAqB,IAAMa,OAAOK,IAAI,CAACX;QACzC;IACF,GAAG;QAACO;QAAcb;QAAYM;QAAYM;QAAQb;QAAsBJ;KAAW;IAEnF,IAAI,CAACK,cAAcL,YAAY;QAC7B,QACGuB,IAAIC,WAAW,GAAG5B,UAAU,MAAM,CAAC,EAAE;QACpC,CAAC6B,IAAIT,EAAE,wCAAwCS,GAAG;QAClD,CAACvC,OAAOwC,YAAY,YAAYC,GAAG,OAAOC,KAAK,QAAQC,KAAKlB,YAAY;UACtE,CAACK,EAAE,4BAA4B;QACjC,EAAE9B,OAAO;MACX,EAAEqC;IAEN;IAEA,QAAQpC,eAAe2C,mBAAmB,OAAOC,aAAaf,EAAE;AAClE,EAAC"}
|
|
@@ -1,36 +1,14 @@
|
|
|
1
|
-
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
1
|
import { LogoutClient } from './LogoutClient.js';
|
|
4
2
|
import './index.scss';
|
|
5
3
|
const baseClass = 'logout';
|
|
6
4
|
export const LogoutView = ({ inactivity, initPageResult, searchParams })=>{
|
|
7
5
|
const { req: { payload: { config: { routes: { admin: adminRoute } } } } } = initPageResult;
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
adminRoute: adminRoute,
|
|
12
|
-
inactivity: inactivity,
|
|
13
|
-
redirect: searchParams.redirect
|
|
14
|
-
}, void 0, false, {
|
|
15
|
-
fileName: "src/views/Logout/index.tsx",
|
|
16
|
-
lineNumber: 27,
|
|
17
|
-
columnNumber: 7
|
|
18
|
-
}, this)
|
|
19
|
-
}, void 0, false, {
|
|
20
|
-
fileName: "src/views/Logout/index.tsx",
|
|
21
|
-
lineNumber: 26,
|
|
22
|
-
columnNumber: 5
|
|
23
|
-
}, this);
|
|
6
|
+
return <div className={`${baseClass}`}>
|
|
7
|
+
<LogoutClient adminRoute={adminRoute} inactivity={inactivity} redirect={searchParams.redirect}/>
|
|
8
|
+
</div>;
|
|
24
9
|
};
|
|
25
10
|
export function LogoutInactivity(props) {
|
|
26
|
-
return
|
|
27
|
-
inactivity: true,
|
|
28
|
-
...props
|
|
29
|
-
}, void 0, false, {
|
|
30
|
-
fileName: "src/views/Logout/index.tsx",
|
|
31
|
-
lineNumber: 37,
|
|
32
|
-
columnNumber: 10
|
|
33
|
-
}, this);
|
|
11
|
+
return <LogoutView inactivity {...props}/>;
|
|
34
12
|
}
|
|
35
13
|
|
|
36
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/Logout/index.tsx"],"sourcesContent":["import type { AdminViewServerProps } from 'payload'\n\nimport React from 'react'\n\nimport { LogoutClient } from './LogoutClient.js'\nimport './index.scss'\n\nconst baseClass = 'logout'\n\nexport const LogoutView: React.FC<\n {\n inactivity?: boolean\n } & AdminViewServerProps\n> = ({ inactivity, initPageResult, searchParams }) => {\n const {\n req: {\n payload: {\n config: {\n routes: { admin: adminRoute },\n },\n },\n },\n } = initPageResult\n\n return (\n <div className={`${baseClass}`}>\n <LogoutClient\n adminRoute={adminRoute}\n inactivity={inactivity}\n redirect={searchParams.redirect as string}\n />\n </div>\n )\n}\n\nexport function LogoutInactivity(props: AdminViewServerProps) {\n return <LogoutView inactivity {...props} />\n}\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/views/Logout/index.tsx"],"sourcesContent":["import type { AdminViewServerProps } from 'payload'\n\nimport React from 'react'\n\nimport { LogoutClient } from './LogoutClient.js'\nimport './index.scss'\n\nconst baseClass = 'logout'\n\nexport const LogoutView: React.FC<\n {\n inactivity?: boolean\n } & AdminViewServerProps\n> = ({ inactivity, initPageResult, searchParams }) => {\n const {\n req: {\n payload: {\n config: {\n routes: { admin: adminRoute },\n },\n },\n },\n } = initPageResult\n\n return (\n <div className={`${baseClass}`}>\n <LogoutClient\n adminRoute={adminRoute}\n inactivity={inactivity}\n redirect={searchParams.redirect as string}\n />\n </div>\n )\n}\n\nexport function LogoutInactivity(props: AdminViewServerProps) {\n return <LogoutView inactivity {...props} />\n}\n"],"names":["LogoutClient","baseClass","LogoutView","inactivity","initPageResult","searchParams","req","payload","config","routes","admin","adminRoute","div","className","redirect","LogoutInactivity","props"],"mappings":"AAIA,SAASA,YAAY,QAAQ,oBAAmB;AAChD,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,OAAO,MAAMC,aAIT,CAAC,EAAEC,UAAU,EAAEC,cAAc,EAAEC,YAAY,EAAE;IAC/C,MAAM,EACJC,KAAK,EACHC,SAAS,EACPC,QAAQ,EACNC,QAAQ,EAAEC,OAAOC,UAAU,EAAE,EAC9B,EACF,EACF,EACF,GAAGP;IAEJ,QACGQ,IAAIC,WAAW,GAAGZ,WAAW,EAAE;MAC9B,CAACD,aACCW,YAAYA,YACZR,YAAYA,YACZW,UAAUT,aAAaS,QAAQ,GAC/B;IACJ,EAAEF;AAEN,EAAC;AAED,OAAO,SAASG,iBAAiBC,KAA2B;IAC1D,QAAQd,WAAWC,YAAY,GAAGa,KAAK;AACzC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
3
2
|
import { Button, Gutter, useConfig, useStepNav, useTranslation } from '@payloadcms/ui';
|
|
4
|
-
import
|
|
3
|
+
import { useEffect } from 'react';
|
|
5
4
|
import './index.scss';
|
|
6
5
|
const baseClass = 'not-found';
|
|
7
6
|
export const NotFoundClient = (props)=>{
|
|
@@ -19,59 +18,20 @@ export const NotFoundClient = (props)=>{
|
|
|
19
18
|
setStepNav,
|
|
20
19
|
t
|
|
21
20
|
]);
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
fileName: "src/views/NotFound/index.client.tsx",
|
|
37
|
-
lineNumber: 39,
|
|
38
|
-
columnNumber: 11
|
|
39
|
-
}, this),
|
|
40
|
-
/*#__PURE__*/ _jsxDEV("p", {
|
|
41
|
-
children: t('general:sorryNotFound')
|
|
42
|
-
}, void 0, false, {
|
|
43
|
-
fileName: "src/views/NotFound/index.client.tsx",
|
|
44
|
-
lineNumber: 40,
|
|
45
|
-
columnNumber: 11
|
|
46
|
-
}, this)
|
|
47
|
-
]
|
|
48
|
-
}, void 0, true, {
|
|
49
|
-
fileName: "src/views/NotFound/index.client.tsx",
|
|
50
|
-
lineNumber: 38,
|
|
51
|
-
columnNumber: 9
|
|
52
|
-
}, this),
|
|
53
|
-
/*#__PURE__*/ _jsxDEV(Button, {
|
|
54
|
-
className: `${baseClass}__button`,
|
|
55
|
-
el: "link",
|
|
56
|
-
size: "large",
|
|
57
|
-
to: adminRoute,
|
|
58
|
-
children: t('general:backToDashboard')
|
|
59
|
-
}, void 0, false, {
|
|
60
|
-
fileName: "src/views/NotFound/index.client.tsx",
|
|
61
|
-
lineNumber: 42,
|
|
62
|
-
columnNumber: 9
|
|
63
|
-
}, this)
|
|
64
|
-
]
|
|
65
|
-
}, void 0, true, {
|
|
66
|
-
fileName: "src/views/NotFound/index.client.tsx",
|
|
67
|
-
lineNumber: 37,
|
|
68
|
-
columnNumber: 7
|
|
69
|
-
}, this)
|
|
70
|
-
}, void 0, false, {
|
|
71
|
-
fileName: "src/views/NotFound/index.client.tsx",
|
|
72
|
-
lineNumber: 32,
|
|
73
|
-
columnNumber: 5
|
|
74
|
-
}, this);
|
|
21
|
+
return <div className={[
|
|
22
|
+
baseClass,
|
|
23
|
+
marginTop && `${baseClass}--margin-top-${marginTop}`
|
|
24
|
+
].filter(Boolean).join(' ')}>
|
|
25
|
+
<Gutter className={`${baseClass}__wrap`}>
|
|
26
|
+
<div className={`${baseClass}__content`}>
|
|
27
|
+
<h1>{t('general:nothingFound')}</h1>
|
|
28
|
+
<p>{t('general:sorryNotFound')}</p>
|
|
29
|
+
</div>
|
|
30
|
+
<Button className={`${baseClass}__button`} el="link" size="large" to={adminRoute}>
|
|
31
|
+
{t('general:backToDashboard')}
|
|
32
|
+
</Button>
|
|
33
|
+
</Gutter>
|
|
34
|
+
</div>;
|
|
75
35
|
};
|
|
76
36
|
|
|
77
37
|
//# sourceMappingURL=index.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/NotFound/index.client.tsx"],"sourcesContent":["'use client'\nimport { Button, Gutter, useConfig, useStepNav, useTranslation } from '@payloadcms/ui'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'not-found'\n\nexport const NotFoundClient: React.FC<{\n marginTop?: 'large'\n}> = (props) => {\n const { marginTop = 'large' } = props\n\n const { setStepNav } = useStepNav()\n const { t } = useTranslation()\n\n const {\n config: {\n routes: { admin: adminRoute },\n },\n } = useConfig()\n\n useEffect(() => {\n setStepNav([\n {\n label: t('general:notFound'),\n },\n ])\n }, [setStepNav, t])\n\n return (\n <div\n className={[baseClass, marginTop && `${baseClass}--margin-top-${marginTop}`]\n .filter(Boolean)\n .join(' ')}\n >\n <Gutter className={`${baseClass}__wrap`}>\n <div className={`${baseClass}__content`}>\n <h1>{t('general:nothingFound')}</h1>\n <p>{t('general:sorryNotFound')}</p>\n </div>\n <Button className={`${baseClass}__button`} el=\"link\" size=\"large\" to={adminRoute}>\n {t('general:backToDashboard')}\n </Button>\n </Gutter>\n </div>\n )\n}\n"],"names":["Button","Gutter","useConfig","useStepNav","useTranslation","
|
|
1
|
+
{"version":3,"sources":["../../../src/views/NotFound/index.client.tsx"],"sourcesContent":["'use client'\nimport { Button, Gutter, useConfig, useStepNav, useTranslation } from '@payloadcms/ui'\nimport React, { useEffect } from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'not-found'\n\nexport const NotFoundClient: React.FC<{\n marginTop?: 'large'\n}> = (props) => {\n const { marginTop = 'large' } = props\n\n const { setStepNav } = useStepNav()\n const { t } = useTranslation()\n\n const {\n config: {\n routes: { admin: adminRoute },\n },\n } = useConfig()\n\n useEffect(() => {\n setStepNav([\n {\n label: t('general:notFound'),\n },\n ])\n }, [setStepNav, t])\n\n return (\n <div\n className={[baseClass, marginTop && `${baseClass}--margin-top-${marginTop}`]\n .filter(Boolean)\n .join(' ')}\n >\n <Gutter className={`${baseClass}__wrap`}>\n <div className={`${baseClass}__content`}>\n <h1>{t('general:nothingFound')}</h1>\n <p>{t('general:sorryNotFound')}</p>\n </div>\n <Button className={`${baseClass}__button`} el=\"link\" size=\"large\" to={adminRoute}>\n {t('general:backToDashboard')}\n </Button>\n </Gutter>\n </div>\n )\n}\n"],"names":["Button","Gutter","useConfig","useStepNav","useTranslation","useEffect","baseClass","NotFoundClient","props","marginTop","setStepNav","t","config","routes","admin","adminRoute","label","div","className","filter","Boolean","join","h1","p","el","size","to"],"mappings":"AAAA;AACA,SAASA,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAEC,cAAc,QAAQ,iBAAgB;AACtF,SAAgBC,SAAS,QAAQ,QAAO;AAExC,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,OAAO,MAAMC,iBAER,CAACC;IACJ,MAAM,EAAEC,YAAY,OAAO,EAAE,GAAGD;IAEhC,MAAM,EAAEE,UAAU,EAAE,GAAGP;IACvB,MAAM,EAAEQ,CAAC,EAAE,GAAGP;IAEd,MAAM,EACJQ,QAAQ,EACNC,QAAQ,EAAEC,OAAOC,UAAU,EAAE,EAC9B,EACF,GAAGb;IAEJG,UAAU;QACRK,WAAW;YACT;gBACEM,OAAOL,EAAE;YACX;SACD;IACH,GAAG;QAACD;QAAYC;KAAE;IAElB,QACGM,IACCC,WAAW;QAACZ;QAAWG,aAAa,GAAGH,UAAU,aAAa,EAAEG,WAAW;KAAC,CACzEU,MAAM,CAACC,SACPC,IAAI,CAAC,MACT;MACC,CAACpB,OAAOiB,WAAW,GAAGZ,UAAU,MAAM,CAAC,EAAE;QACvC,CAACW,IAAIC,WAAW,GAAGZ,UAAU,SAAS,CAAC,EAAE;UACvC,CAACgB,IAAIX,EAAE,0BAA0BW,GAAG;UACpC,CAACC,GAAGZ,EAAE,2BAA2BY,EAAE;QACrC,EAAEN,IAAI;QACN,CAACjB,OAAOkB,WAAW,GAAGZ,UAAU,QAAQ,CAAC,EAAEkB,GAAG,OAAOC,KAAK,QAAQC,IAAIX,YAAY;UAChF,CAACJ,EAAE,2BAA2B;QAChC,EAAEX,OAAO;MACX,EAAEC,OAAO;IACX,EAAEgB;AAEN,EAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
2
1
|
import { formatAdminURL } from 'payload/shared';
|
|
3
2
|
import * as qs from 'qs-esm';
|
|
4
|
-
import React from 'react';
|
|
5
3
|
import { DefaultTemplate } from '../../templates/Default/index.js';
|
|
6
4
|
import { getNextRequestI18n } from '../../utilities/getNextRequestI18n.js';
|
|
7
5
|
import { getVisibleEntities } from '../../utilities/getVisibleEntities.js';
|
|
@@ -42,44 +40,18 @@ export const NotFoundPage = async ({ config: configPromise, importMap, params: p
|
|
|
42
40
|
}
|
|
43
41
|
});
|
|
44
42
|
if (!req.user || !permissions.canAccessAdmin) {
|
|
45
|
-
return
|
|
46
|
-
fileName: "src/views/NotFound/index.tsx",
|
|
47
|
-
lineNumber: 73,
|
|
48
|
-
columnNumber: 12
|
|
49
|
-
}, this);
|
|
43
|
+
return <NotFoundClient/>;
|
|
50
44
|
}
|
|
51
45
|
const params = await paramsPromise;
|
|
52
46
|
const visibleEntities = getVisibleEntities({
|
|
53
47
|
req
|
|
54
48
|
});
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
params: params,
|
|
59
|
-
payload: payload,
|
|
60
|
-
permissions: permissions,
|
|
61
|
-
searchParams: searchParams,
|
|
62
|
-
user: req.user,
|
|
63
|
-
visibleEntities: visibleEntities,
|
|
64
|
-
children: /*#__PURE__*/ _jsxDEV(NotFoundClient, {}, void 0, false, {
|
|
65
|
-
fileName: "src/views/NotFound/index.tsx",
|
|
66
|
-
lineNumber: 90,
|
|
67
|
-
columnNumber: 7
|
|
68
|
-
}, this)
|
|
69
|
-
}, void 0, false, {
|
|
70
|
-
fileName: "src/views/NotFound/index.tsx",
|
|
71
|
-
lineNumber: 80,
|
|
72
|
-
columnNumber: 5
|
|
73
|
-
}, this);
|
|
49
|
+
return <DefaultTemplate i18n={req.i18n} locale={locale} params={params} payload={payload} permissions={permissions} searchParams={searchParams} user={req.user} visibleEntities={visibleEntities}>
|
|
50
|
+
<NotFoundClient/>
|
|
51
|
+
</DefaultTemplate>;
|
|
74
52
|
};
|
|
75
53
|
export function NotFoundView(props) {
|
|
76
|
-
return
|
|
77
|
-
marginTop: "large"
|
|
78
|
-
}, void 0, false, {
|
|
79
|
-
fileName: "src/views/NotFound/index.tsx",
|
|
80
|
-
lineNumber: 96,
|
|
81
|
-
columnNumber: 10
|
|
82
|
-
}, this);
|
|
54
|
+
return <NotFoundClient marginTop="large"/>;
|
|
83
55
|
}
|
|
84
56
|
|
|
85
57
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/NotFound/index.tsx"],"sourcesContent":["import type { Metadata } from 'next'\nimport type { AdminViewServerProps, ImportMap, SanitizedConfig } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React from 'react'\n\nimport { DefaultTemplate } from '../../templates/Default/index.js'\nimport { getNextRequestI18n } from '../../utilities/getNextRequestI18n.js'\nimport { getVisibleEntities } from '../../utilities/getVisibleEntities.js'\nimport { initReq } from '../../utilities/initReq.js'\nimport { NotFoundClient } from './index.client.js'\n\nexport const generateNotFoundViewMetadata = async ({\n config: configPromise,\n}: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n params?: { [key: string]: string | string[] }\n}): Promise<Metadata> => {\n const config = await configPromise\n\n const i18n = await getNextRequestI18n({\n config,\n })\n\n return {\n title: i18n.t('general:notFound'),\n }\n}\n\nexport const NotFoundPage = async ({\n config: configPromise,\n importMap,\n params: paramsPromise,\n searchParams: searchParamsPromise,\n}: {\n config: Promise<SanitizedConfig>\n importMap: ImportMap\n params: Promise<{\n segments: string[]\n }>\n searchParams: Promise<{\n [key: string]: string | string[]\n }>\n}) => {\n const config = await configPromise\n const { routes: { admin: adminRoute } = {} } = config\n\n const searchParams = await searchParamsPromise\n const queryString = `${qs.stringify(searchParams ?? {}, { addQueryPrefix: true })}`\n const {\n locale,\n permissions,\n req,\n req: { payload },\n } = await initReq({\n configPromise: config,\n importMap,\n key: 'RootLayout',\n overrides: {\n fallbackLocale: false,\n req: {\n query: qs.parse(queryString, {\n depth: 10,\n ignoreQueryPrefix: true,\n }),\n },\n urlSuffix: `${formatAdminURL({ adminRoute, path: '/not-found' })}${searchParams ? queryString : ''}`,\n },\n })\n\n if (!req.user || !permissions.canAccessAdmin) {\n return <NotFoundClient />\n }\n\n const params = await paramsPromise\n const visibleEntities = getVisibleEntities({ req })\n\n return (\n <DefaultTemplate\n i18n={req.i18n}\n locale={locale}\n params={params}\n payload={payload}\n permissions={permissions}\n searchParams={searchParams}\n user={req.user}\n visibleEntities={visibleEntities}\n >\n <NotFoundClient />\n </DefaultTemplate>\n )\n}\n\nexport function NotFoundView(props: AdminViewServerProps) {\n return <NotFoundClient marginTop=\"large\" />\n}\n"],"names":["formatAdminURL","qs","
|
|
1
|
+
{"version":3,"sources":["../../../src/views/NotFound/index.tsx"],"sourcesContent":["import type { Metadata } from 'next'\nimport type { AdminViewServerProps, ImportMap, SanitizedConfig } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\nimport React from 'react'\n\nimport { DefaultTemplate } from '../../templates/Default/index.js'\nimport { getNextRequestI18n } from '../../utilities/getNextRequestI18n.js'\nimport { getVisibleEntities } from '../../utilities/getVisibleEntities.js'\nimport { initReq } from '../../utilities/initReq.js'\nimport { NotFoundClient } from './index.client.js'\n\nexport const generateNotFoundViewMetadata = async ({\n config: configPromise,\n}: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n params?: { [key: string]: string | string[] }\n}): Promise<Metadata> => {\n const config = await configPromise\n\n const i18n = await getNextRequestI18n({\n config,\n })\n\n return {\n title: i18n.t('general:notFound'),\n }\n}\n\nexport const NotFoundPage = async ({\n config: configPromise,\n importMap,\n params: paramsPromise,\n searchParams: searchParamsPromise,\n}: {\n config: Promise<SanitizedConfig>\n importMap: ImportMap\n params: Promise<{\n segments: string[]\n }>\n searchParams: Promise<{\n [key: string]: string | string[]\n }>\n}) => {\n const config = await configPromise\n const { routes: { admin: adminRoute } = {} } = config\n\n const searchParams = await searchParamsPromise\n const queryString = `${qs.stringify(searchParams ?? {}, { addQueryPrefix: true })}`\n const {\n locale,\n permissions,\n req,\n req: { payload },\n } = await initReq({\n configPromise: config,\n importMap,\n key: 'RootLayout',\n overrides: {\n fallbackLocale: false,\n req: {\n query: qs.parse(queryString, {\n depth: 10,\n ignoreQueryPrefix: true,\n }),\n },\n urlSuffix: `${formatAdminURL({ adminRoute, path: '/not-found' })}${searchParams ? queryString : ''}`,\n },\n })\n\n if (!req.user || !permissions.canAccessAdmin) {\n return <NotFoundClient />\n }\n\n const params = await paramsPromise\n const visibleEntities = getVisibleEntities({ req })\n\n return (\n <DefaultTemplate\n i18n={req.i18n}\n locale={locale}\n params={params}\n payload={payload}\n permissions={permissions}\n searchParams={searchParams}\n user={req.user}\n visibleEntities={visibleEntities}\n >\n <NotFoundClient />\n </DefaultTemplate>\n )\n}\n\nexport function NotFoundView(props: AdminViewServerProps) {\n return <NotFoundClient marginTop=\"large\" />\n}\n"],"names":["formatAdminURL","qs","DefaultTemplate","getNextRequestI18n","getVisibleEntities","initReq","NotFoundClient","generateNotFoundViewMetadata","config","configPromise","i18n","title","t","NotFoundPage","importMap","params","paramsPromise","searchParams","searchParamsPromise","routes","admin","adminRoute","queryString","stringify","addQueryPrefix","locale","permissions","req","payload","key","overrides","fallbackLocale","query","parse","depth","ignoreQueryPrefix","urlSuffix","path","user","canAccessAdmin","visibleEntities","NotFoundView","props","marginTop"],"mappings":"AAGA,SAASA,cAAc,QAAQ,iBAAgB;AAC/C,YAAYC,QAAQ,SAAQ;AAG5B,SAASC,eAAe,QAAQ,mCAAkC;AAClE,SAASC,kBAAkB,QAAQ,wCAAuC;AAC1E,SAASC,kBAAkB,QAAQ,wCAAuC;AAC1E,SAASC,OAAO,QAAQ,6BAA4B;AACpD,SAASC,cAAc,QAAQ,oBAAmB;AAElD,OAAO,MAAMC,+BAA+B,OAAO,EACjDC,QAAQC,aAAa,EAItB;IACC,MAAMD,SAAS,MAAMC;IAErB,MAAMC,OAAO,MAAMP,mBAAmB;QACpCK;IACF;IAEA,OAAO;QACLG,OAAOD,KAAKE,CAAC,CAAC;IAChB;AACF,EAAC;AAED,OAAO,MAAMC,eAAe,OAAO,EACjCL,QAAQC,aAAa,EACrBK,SAAS,EACTC,QAAQC,aAAa,EACrBC,cAAcC,mBAAmB,EAUlC;IACC,MAAMV,SAAS,MAAMC;IACrB,MAAM,EAAEU,QAAQ,EAAEC,OAAOC,UAAU,EAAE,GAAG,CAAC,CAAC,EAAE,GAAGb;IAE/C,MAAMS,eAAe,MAAMC;IAC3B,MAAMI,cAAc,GAAGrB,GAAGsB,SAAS,CAACN,gBAAgB,CAAC,GAAG;QAAEO,gBAAgB;IAAK,IAAI;IACnF,MAAM,EACJC,MAAM,EACNC,WAAW,EACXC,GAAG,EACHA,KAAK,EAAEC,OAAO,EAAE,EACjB,GAAG,MAAMvB,QAAQ;QAChBI,eAAeD;QACfM;QACAe,KAAK;QACLC,WAAW;YACTC,gBAAgB;YAChBJ,KAAK;gBACHK,OAAO/B,GAAGgC,KAAK,CAACX,aAAa;oBAC3BY,OAAO;oBACPC,mBAAmB;gBACrB;YACF;YACAC,WAAW,GAAGpC,eAAe;gBAAEqB;gBAAYgB,MAAM;YAAa,KAAKpB,eAAeK,cAAc,IAAI;QACtG;IACF;IAEA,IAAI,CAACK,IAAIW,IAAI,IAAI,CAACZ,YAAYa,cAAc,EAAE;QAC5C,QAAQjC;IACV;IAEA,MAAMS,SAAS,MAAMC;IACrB,MAAMwB,kBAAkBpC,mBAAmB;QAAEuB;IAAI;IAEjD,QACGzB,gBACCQ,MAAMiB,IAAIjB,IAAI,EACde,QAAQA,QACRV,QAAQA,QACRa,SAASA,SACTF,aAAaA,aACbT,cAAcA,cACdqB,MAAMX,IAAIW,IAAI,EACdE,iBAAiBA,iBAClB;MACC,CAAClC,gBAAiB;IACpB,EAAEJ;AAEN,EAAC;AAED,OAAO,SAASuC,aAAaC,KAA2B;IACtD,QAAQpC,eAAeqC,UAAU;AACnC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
3
2
|
import { ConfirmPasswordField, Form, FormSubmit, HiddenField, PasswordField, useAuth, useConfig, useTranslation } from '@payloadcms/ui';
|
|
4
3
|
import { useRouter } from 'next/navigation.js';
|
|
5
4
|
import { formatAdminURL } from 'payload/shared';
|
|
@@ -42,62 +41,18 @@ export const ResetPasswordForm = ({ token })=>{
|
|
|
42
41
|
value: token
|
|
43
42
|
}
|
|
44
43
|
};
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
label: i18n.t('authentication:newPassword'),
|
|
58
|
-
required: true
|
|
59
|
-
},
|
|
60
|
-
path: "password",
|
|
61
|
-
schemaPath: `${userSlug}.password`
|
|
62
|
-
}, void 0, false, {
|
|
63
|
-
fileName: "src/views/ResetPassword/ResetPasswordForm/index.tsx",
|
|
64
|
-
lineNumber: 77,
|
|
65
|
-
columnNumber: 9
|
|
66
|
-
}, this),
|
|
67
|
-
/*#__PURE__*/ _jsxDEV(ConfirmPasswordField, {}, void 0, false, {
|
|
68
|
-
fileName: "src/views/ResetPassword/ResetPasswordForm/index.tsx",
|
|
69
|
-
lineNumber: 86,
|
|
70
|
-
columnNumber: 9
|
|
71
|
-
}, this),
|
|
72
|
-
/*#__PURE__*/ _jsxDEV(HiddenField, {
|
|
73
|
-
path: "token",
|
|
74
|
-
schemaPath: `${userSlug}.token`,
|
|
75
|
-
value: token
|
|
76
|
-
}, void 0, false, {
|
|
77
|
-
fileName: "src/views/ResetPassword/ResetPasswordForm/index.tsx",
|
|
78
|
-
lineNumber: 87,
|
|
79
|
-
columnNumber: 9
|
|
80
|
-
}, this)
|
|
81
|
-
]
|
|
82
|
-
}, void 0, true, {
|
|
83
|
-
fileName: "src/views/ResetPassword/ResetPasswordForm/index.tsx",
|
|
84
|
-
lineNumber: 76,
|
|
85
|
-
columnNumber: 7
|
|
86
|
-
}, this),
|
|
87
|
-
/*#__PURE__*/ _jsxDEV(FormSubmit, {
|
|
88
|
-
size: "large",
|
|
89
|
-
children: i18n.t('authentication:resetPassword')
|
|
90
|
-
}, void 0, false, {
|
|
91
|
-
fileName: "src/views/ResetPassword/ResetPasswordForm/index.tsx",
|
|
92
|
-
lineNumber: 89,
|
|
93
|
-
columnNumber: 7
|
|
94
|
-
}, this)
|
|
95
|
-
]
|
|
96
|
-
}, void 0, true, {
|
|
97
|
-
fileName: "src/views/ResetPassword/ResetPasswordForm/index.tsx",
|
|
98
|
-
lineNumber: 70,
|
|
99
|
-
columnNumber: 5
|
|
100
|
-
}, this);
|
|
44
|
+
return <Form action={`${serverURL}${apiRoute}/${userSlug}/reset-password`} initialState={initialState} method="POST" onSuccess={onSuccess}>
|
|
45
|
+
<div className="inputWrap">
|
|
46
|
+
<PasswordField field={{
|
|
47
|
+
name: 'password',
|
|
48
|
+
label: i18n.t('authentication:newPassword'),
|
|
49
|
+
required: true
|
|
50
|
+
}} path="password" schemaPath={`${userSlug}.password`}/>
|
|
51
|
+
<ConfirmPasswordField/>
|
|
52
|
+
<HiddenField path="token" schemaPath={`${userSlug}.token`} value={token}/>
|
|
53
|
+
</div>
|
|
54
|
+
<FormSubmit size="large">{i18n.t('authentication:resetPassword')}</FormSubmit>
|
|
55
|
+
</Form>;
|
|
101
56
|
};
|
|
102
57
|
|
|
103
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/views/ResetPassword/ResetPasswordForm/index.tsx"],"sourcesContent":["'use client'\nimport {\n ConfirmPasswordField,\n Form,\n FormSubmit,\n HiddenField,\n PasswordField,\n useAuth,\n useConfig,\n useTranslation,\n} from '@payloadcms/ui'\nimport { useRouter } from 'next/navigation.js'\nimport { type FormState } from 'payload'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\ntype Args = {\n readonly token: string\n}\n\nexport const ResetPasswordForm: React.FC<Args> = ({ token }) => {\n const i18n = useTranslation()\n const {\n config: {\n admin: {\n routes: { login: loginRoute },\n user: userSlug,\n },\n routes: { admin: adminRoute, api: apiRoute },\n serverURL,\n },\n } = useConfig()\n\n const history = useRouter()\n const { fetchFullUser } = useAuth()\n\n const onSuccess = React.useCallback(async () => {\n const user = await fetchFullUser()\n if (user) {\n history.push(adminRoute)\n } else {\n history.push(\n formatAdminURL({\n adminRoute,\n path: loginRoute,\n }),\n )\n }\n }, [adminRoute, fetchFullUser, history, loginRoute])\n\n const initialState: FormState = {\n 'confirm-password': {\n initialValue: '',\n valid: false,\n value: '',\n },\n password: {\n initialValue: '',\n valid: false,\n value: '',\n },\n token: {\n initialValue: token,\n valid: true,\n value: token,\n },\n }\n\n return (\n <Form\n action={`${serverURL}${apiRoute}/${userSlug}/reset-password`}\n initialState={initialState}\n method=\"POST\"\n onSuccess={onSuccess}\n >\n <div className=\"inputWrap\">\n <PasswordField\n field={{\n name: 'password',\n label: i18n.t('authentication:newPassword'),\n required: true,\n }}\n path=\"password\"\n schemaPath={`${userSlug}.password`}\n />\n <ConfirmPasswordField />\n <HiddenField path=\"token\" schemaPath={`${userSlug}.token`} value={token} />\n </div>\n <FormSubmit size=\"large\">{i18n.t('authentication:resetPassword')}</FormSubmit>\n </Form>\n )\n}\n"],"names":["ConfirmPasswordField","Form","FormSubmit","HiddenField","PasswordField","useAuth","useConfig","useTranslation","useRouter","formatAdminURL","React","ResetPasswordForm","token","i18n","config","admin","routes","login","loginRoute","user","userSlug","adminRoute","api","apiRoute","serverURL","history","fetchFullUser","onSuccess","useCallback","push","path","initialState","initialValue","valid","value","password","action","method","div","className","field","name","label","t","required","schemaPath","size"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../../../src/views/ResetPassword/ResetPasswordForm/index.tsx"],"sourcesContent":["'use client'\nimport {\n ConfirmPasswordField,\n Form,\n FormSubmit,\n HiddenField,\n PasswordField,\n useAuth,\n useConfig,\n useTranslation,\n} from '@payloadcms/ui'\nimport { useRouter } from 'next/navigation.js'\nimport { type FormState } from 'payload'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\ntype Args = {\n readonly token: string\n}\n\nexport const ResetPasswordForm: React.FC<Args> = ({ token }) => {\n const i18n = useTranslation()\n const {\n config: {\n admin: {\n routes: { login: loginRoute },\n user: userSlug,\n },\n routes: { admin: adminRoute, api: apiRoute },\n serverURL,\n },\n } = useConfig()\n\n const history = useRouter()\n const { fetchFullUser } = useAuth()\n\n const onSuccess = React.useCallback(async () => {\n const user = await fetchFullUser()\n if (user) {\n history.push(adminRoute)\n } else {\n history.push(\n formatAdminURL({\n adminRoute,\n path: loginRoute,\n }),\n )\n }\n }, [adminRoute, fetchFullUser, history, loginRoute])\n\n const initialState: FormState = {\n 'confirm-password': {\n initialValue: '',\n valid: false,\n value: '',\n },\n password: {\n initialValue: '',\n valid: false,\n value: '',\n },\n token: {\n initialValue: token,\n valid: true,\n value: token,\n },\n }\n\n return (\n <Form\n action={`${serverURL}${apiRoute}/${userSlug}/reset-password`}\n initialState={initialState}\n method=\"POST\"\n onSuccess={onSuccess}\n >\n <div className=\"inputWrap\">\n <PasswordField\n field={{\n name: 'password',\n label: i18n.t('authentication:newPassword'),\n required: true,\n }}\n path=\"password\"\n schemaPath={`${userSlug}.password`}\n />\n <ConfirmPasswordField />\n <HiddenField path=\"token\" schemaPath={`${userSlug}.token`} value={token} />\n </div>\n <FormSubmit size=\"large\">{i18n.t('authentication:resetPassword')}</FormSubmit>\n </Form>\n )\n}\n"],"names":["ConfirmPasswordField","Form","FormSubmit","HiddenField","PasswordField","useAuth","useConfig","useTranslation","useRouter","formatAdminURL","React","ResetPasswordForm","token","i18n","config","admin","routes","login","loginRoute","user","userSlug","adminRoute","api","apiRoute","serverURL","history","fetchFullUser","onSuccess","useCallback","push","path","initialState","initialValue","valid","value","password","action","method","div","className","field","name","label","t","required","schemaPath","size"],"mappings":"AAAA;AACA,SACEA,oBAAoB,EACpBC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,aAAa,EACbC,OAAO,EACPC,SAAS,EACTC,cAAc,QACT,iBAAgB;AACvB,SAASC,SAAS,QAAQ,qBAAoB;AAE9C,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,OAAOC,WAAW,QAAO;AAMzB,OAAO,MAAMC,oBAAoC,CAAC,EAAEC,KAAK,EAAE;IACzD,MAAMC,OAAON;IACb,MAAM,EACJO,QAAQ,EACNC,OAAO,EACLC,QAAQ,EAAEC,OAAOC,UAAU,EAAE,EAC7BC,MAAMC,QAAQ,EACf,EACDJ,QAAQ,EAAED,OAAOM,UAAU,EAAEC,KAAKC,QAAQ,EAAE,EAC5CC,SAAS,EACV,EACF,GAAGlB;IAEJ,MAAMmB,UAAUjB;IAChB,MAAM,EAAEkB,aAAa,EAAE,GAAGrB;IAE1B,MAAMsB,YAAYjB,MAAMkB,WAAW,CAAC;QAClC,MAAMT,OAAO,MAAMO;QACnB,IAAIP,MAAM;YACRM,QAAQI,IAAI,CAACR;QACf,OAAO;YACLI,QAAQI,IAAI,CACVpB,eAAe;gBACbY;gBACAS,MAAMZ;YACR;QAEJ;IACF,GAAG;QAACG;QAAYK;QAAeD;QAASP;KAAW;IAEnD,MAAMa,eAA0B;QAC9B,oBAAoB;YAClBC,cAAc;YACdC,OAAO;YACPC,OAAO;QACT;QACAC,UAAU;YACRH,cAAc;YACdC,OAAO;YACPC,OAAO;QACT;QACAtB,OAAO;YACLoB,cAAcpB;YACdqB,OAAO;YACPC,OAAOtB;QACT;IACF;IAEA,QACGX,KACCmC,QAAQ,GAAGZ,YAAYD,SAAS,CAAC,EAAEH,SAAS,eAAe,CAAC,EAC5DW,cAAcA,cACdM,OAAO,OACPV,WAAWA,WACZ;MACC,CAACW,IAAIC,UAAU,YAAY;QACzB,CAACnC,cACCoC,OAAO;QACLC,MAAM;QACNC,OAAO7B,KAAK8B,CAAC,CAAC;QACdC,UAAU;IACZ,GACAd,KAAK,WACLe,YAAY,GAAGzB,SAAS,SAAS,CAAC,GAClC;QACF,CAACpB,sBAAuB;QACxB,CAACG,YAAY2B,KAAK,QAAQe,YAAY,GAAGzB,SAAS,MAAM,CAAC,EAAEc,OAAOtB,QAAS;MAC7E,EAAE0B,IAAI;MACN,CAACpC,WAAW4C,KAAK,SAASjC,KAAK8B,CAAC,CAAC,kCAAkCzC,WAAW;IAChF,EAAED;AAEN,EAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
|
|
2
1
|
import { Button, Link } from '@payloadcms/ui';
|
|
3
2
|
import { Translation } from '@payloadcms/ui/shared';
|
|
4
3
|
import { formatAdminURL } from 'payload/shared';
|
|
5
|
-
import React from 'react';
|
|
6
4
|
import { FormHeader } from '../../elements/FormHeader/index.js';
|
|
7
5
|
import { ResetPasswordForm } from './ResetPasswordForm/index.js';
|
|
8
6
|
import './index.scss';
|
|
@@ -13,91 +11,30 @@ export function ResetPassword({ initPageResult, params }) {
|
|
|
13
11
|
const { i18n, payload: { config }, user } = req;
|
|
14
12
|
const { admin: { routes: { account: accountRoute, login: loginRoute } }, routes: { admin: adminRoute } } = config;
|
|
15
13
|
if (user) {
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/*#__PURE__*/ _jsxDEV(FormHeader, {
|
|
20
|
-
description: /*#__PURE__*/ _jsxDEV(Translation, {
|
|
21
|
-
elements: {
|
|
22
|
-
'0': ({ children })=>/*#__PURE__*/ _jsxDEV(Link, {
|
|
23
|
-
href: formatAdminURL({
|
|
24
|
-
adminRoute,
|
|
25
|
-
path: accountRoute
|
|
26
|
-
}),
|
|
27
|
-
prefetch: false,
|
|
28
|
-
children: children
|
|
29
|
-
}, void 0, false, {
|
|
30
|
-
fileName: "src/views/ResetPassword/index.tsx",
|
|
31
|
-
lineNumber: 42,
|
|
32
|
-
columnNumber: 19
|
|
33
|
-
}, void 0)
|
|
34
|
-
},
|
|
35
|
-
i18nKey: "authentication:loggedInChangePassword",
|
|
36
|
-
t: i18n.t
|
|
37
|
-
}, void 0, false, {
|
|
38
|
-
fileName: "src/views/ResetPassword/index.tsx",
|
|
39
|
-
lineNumber: 39,
|
|
40
|
-
columnNumber: 13
|
|
41
|
-
}, void 0),
|
|
42
|
-
heading: i18n.t('authentication:alreadyLoggedIn')
|
|
43
|
-
}, void 0, false, {
|
|
44
|
-
fileName: "src/views/ResetPassword/index.tsx",
|
|
45
|
-
lineNumber: 37,
|
|
46
|
-
columnNumber: 9
|
|
47
|
-
}, this),
|
|
48
|
-
/*#__PURE__*/ _jsxDEV(Button, {
|
|
49
|
-
buttonStyle: "secondary",
|
|
50
|
-
el: "link",
|
|
51
|
-
size: "large",
|
|
52
|
-
to: adminRoute,
|
|
53
|
-
children: i18n.t('general:backToDashboard')
|
|
54
|
-
}, void 0, false, {
|
|
55
|
-
fileName: "src/views/ResetPassword/index.tsx",
|
|
56
|
-
lineNumber: 59,
|
|
57
|
-
columnNumber: 9
|
|
58
|
-
}, this)
|
|
59
|
-
]
|
|
60
|
-
}, void 0, true, {
|
|
61
|
-
fileName: "src/views/ResetPassword/index.tsx",
|
|
62
|
-
lineNumber: 36,
|
|
63
|
-
columnNumber: 7
|
|
64
|
-
}, this);
|
|
65
|
-
}
|
|
66
|
-
return /*#__PURE__*/ _jsxDEV("div", {
|
|
67
|
-
className: `${resetPasswordBaseClass}__wrap`,
|
|
68
|
-
children: [
|
|
69
|
-
/*#__PURE__*/ _jsxDEV(FormHeader, {
|
|
70
|
-
heading: i18n.t('authentication:resetPassword')
|
|
71
|
-
}, void 0, false, {
|
|
72
|
-
fileName: "src/views/ResetPassword/index.tsx",
|
|
73
|
-
lineNumber: 68,
|
|
74
|
-
columnNumber: 7
|
|
75
|
-
}, this),
|
|
76
|
-
/*#__PURE__*/ _jsxDEV(ResetPasswordForm, {
|
|
77
|
-
token: token
|
|
78
|
-
}, void 0, false, {
|
|
79
|
-
fileName: "src/views/ResetPassword/index.tsx",
|
|
80
|
-
lineNumber: 69,
|
|
81
|
-
columnNumber: 7
|
|
82
|
-
}, this),
|
|
83
|
-
/*#__PURE__*/ _jsxDEV(Link, {
|
|
84
|
-
href: formatAdminURL({
|
|
14
|
+
return <div className={`${resetPasswordBaseClass}__wrap`}>
|
|
15
|
+
<FormHeader description={<Translation elements={{
|
|
16
|
+
'0': ({ children })=><Link href={formatAdminURL({
|
|
85
17
|
adminRoute,
|
|
86
|
-
path:
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
18
|
+
path: accountRoute
|
|
19
|
+
})} prefetch={false}>
|
|
20
|
+
{children}
|
|
21
|
+
</Link>
|
|
22
|
+
}} i18nKey="authentication:loggedInChangePassword" t={i18n.t}/>} heading={i18n.t('authentication:alreadyLoggedIn')}/>
|
|
23
|
+
<Button buttonStyle="secondary" el="link" size="large" to={adminRoute}>
|
|
24
|
+
{i18n.t('general:backToDashboard')}
|
|
25
|
+
</Button>
|
|
26
|
+
</div>;
|
|
27
|
+
}
|
|
28
|
+
return <div className={`${resetPasswordBaseClass}__wrap`}>
|
|
29
|
+
<FormHeader heading={i18n.t('authentication:resetPassword')}/>
|
|
30
|
+
<ResetPasswordForm token={token}/>
|
|
31
|
+
<Link href={formatAdminURL({
|
|
32
|
+
adminRoute,
|
|
33
|
+
path: loginRoute
|
|
34
|
+
})} prefetch={false}>
|
|
35
|
+
{i18n.t('authentication:backToLogin')}
|
|
36
|
+
</Link>
|
|
37
|
+
</div>;
|
|
101
38
|
}
|
|
102
39
|
|
|
103
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/views/ResetPassword/index.tsx"],"sourcesContent":["import type { AdminViewServerProps } from 'payload'\n\nimport { Button, Link } from '@payloadcms/ui'\nimport { Translation } from '@payloadcms/ui/shared'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nimport { FormHeader } from '../../elements/FormHeader/index.js'\nimport { ResetPasswordForm } from './ResetPasswordForm/index.js'\nimport './index.scss'\n\nexport const resetPasswordBaseClass = 'reset-password'\n\nexport function ResetPassword({ initPageResult, params }: AdminViewServerProps) {\n const { req } = initPageResult\n\n const {\n segments: [_, token],\n } = params\n\n const {\n i18n,\n payload: { config },\n user,\n } = req\n\n const {\n admin: {\n routes: { account: accountRoute, login: loginRoute },\n },\n routes: { admin: adminRoute },\n } = config\n\n if (user) {\n return (\n <div className={`${resetPasswordBaseClass}__wrap`}>\n <FormHeader\n description={\n <Translation\n elements={{\n '0': ({ children }) => (\n <Link\n href={formatAdminURL({\n adminRoute,\n path: accountRoute,\n })}\n prefetch={false}\n >\n {children}\n </Link>\n ),\n }}\n i18nKey=\"authentication:loggedInChangePassword\"\n t={i18n.t}\n />\n }\n heading={i18n.t('authentication:alreadyLoggedIn')}\n />\n <Button buttonStyle=\"secondary\" el=\"link\" size=\"large\" to={adminRoute}>\n {i18n.t('general:backToDashboard')}\n </Button>\n </div>\n )\n }\n\n return (\n <div className={`${resetPasswordBaseClass}__wrap`}>\n <FormHeader heading={i18n.t('authentication:resetPassword')} />\n <ResetPasswordForm token={token} />\n <Link\n href={formatAdminURL({\n adminRoute,\n path: loginRoute,\n })}\n prefetch={false}\n >\n {i18n.t('authentication:backToLogin')}\n </Link>\n </div>\n )\n}\n"],"names":["Button","Link","Translation","formatAdminURL","
|
|
1
|
+
{"version":3,"sources":["../../../src/views/ResetPassword/index.tsx"],"sourcesContent":["import type { AdminViewServerProps } from 'payload'\n\nimport { Button, Link } from '@payloadcms/ui'\nimport { Translation } from '@payloadcms/ui/shared'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nimport { FormHeader } from '../../elements/FormHeader/index.js'\nimport { ResetPasswordForm } from './ResetPasswordForm/index.js'\nimport './index.scss'\n\nexport const resetPasswordBaseClass = 'reset-password'\n\nexport function ResetPassword({ initPageResult, params }: AdminViewServerProps) {\n const { req } = initPageResult\n\n const {\n segments: [_, token],\n } = params\n\n const {\n i18n,\n payload: { config },\n user,\n } = req\n\n const {\n admin: {\n routes: { account: accountRoute, login: loginRoute },\n },\n routes: { admin: adminRoute },\n } = config\n\n if (user) {\n return (\n <div className={`${resetPasswordBaseClass}__wrap`}>\n <FormHeader\n description={\n <Translation\n elements={{\n '0': ({ children }) => (\n <Link\n href={formatAdminURL({\n adminRoute,\n path: accountRoute,\n })}\n prefetch={false}\n >\n {children}\n </Link>\n ),\n }}\n i18nKey=\"authentication:loggedInChangePassword\"\n t={i18n.t}\n />\n }\n heading={i18n.t('authentication:alreadyLoggedIn')}\n />\n <Button buttonStyle=\"secondary\" el=\"link\" size=\"large\" to={adminRoute}>\n {i18n.t('general:backToDashboard')}\n </Button>\n </div>\n )\n }\n\n return (\n <div className={`${resetPasswordBaseClass}__wrap`}>\n <FormHeader heading={i18n.t('authentication:resetPassword')} />\n <ResetPasswordForm token={token} />\n <Link\n href={formatAdminURL({\n adminRoute,\n path: loginRoute,\n })}\n prefetch={false}\n >\n {i18n.t('authentication:backToLogin')}\n </Link>\n </div>\n )\n}\n"],"names":["Button","Link","Translation","formatAdminURL","FormHeader","ResetPasswordForm","resetPasswordBaseClass","ResetPassword","initPageResult","params","req","segments","_","token","i18n","payload","config","user","admin","routes","account","accountRoute","login","loginRoute","adminRoute","div","className","description","elements","children","href","path","prefetch","i18nKey","t","heading","buttonStyle","el","size","to"],"mappings":"AAEA,SAASA,MAAM,EAAEC,IAAI,QAAQ,iBAAgB;AAC7C,SAASC,WAAW,QAAQ,wBAAuB;AACnD,SAASC,cAAc,QAAQ,iBAAgB;AAG/C,SAASC,UAAU,QAAQ,qCAAoC;AAC/D,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,OAAO,eAAc;AAErB,OAAO,MAAMC,yBAAyB,iBAAgB;AAEtD,OAAO,SAASC,cAAc,EAAEC,cAAc,EAAEC,MAAM,EAAwB;IAC5E,MAAM,EAAEC,GAAG,EAAE,GAAGF;IAEhB,MAAM,EACJG,UAAU,CAACC,GAAGC,MAAM,EACrB,GAAGJ;IAEJ,MAAM,EACJK,IAAI,EACJC,SAAS,EAAEC,MAAM,EAAE,EACnBC,IAAI,EACL,GAAGP;IAEJ,MAAM,EACJQ,OAAO,EACLC,QAAQ,EAAEC,SAASC,YAAY,EAAEC,OAAOC,UAAU,EAAE,EACrD,EACDJ,QAAQ,EAAED,OAAOM,UAAU,EAAE,EAC9B,GAAGR;IAEJ,IAAIC,MAAM;QACR,QACGQ,IAAIC,WAAW,GAAGpB,uBAAuB,MAAM,CAAC,EAAE;QACjD,CAACF,WACCuB,cACGzB,YACC0B,UAAU;YACR,KAAK,CAAC,EAAEC,QAAQ,EAAE,IACf5B,KACC6B,MAAM3B,eAAe;oBACnBqB;oBACAO,MAAMV;gBACR,IACAW,UAAU,OACX;oBACC,CAACH,SAAS;kBACZ,EAAE5B;QAEN,GACAgC,QAAQ,wCACRC,GAAGpB,KAAKoB,CAAC,KAGbC,SAASrB,KAAKoB,CAAC,CAAC,oCAChB;QACF,CAAClC,OAAOoC,YAAY,YAAYC,GAAG,OAAOC,KAAK,QAAQC,IAAIf,YAAY;UACrE,CAACV,KAAKoB,CAAC,CAAC,2BAA2B;QACrC,EAAElC,OAAO;MACX,EAAEyB;IAEN;IAEA,QACGA,IAAIC,WAAW,GAAGpB,uBAAuB,MAAM,CAAC,EAAE;MACjD,CAACF,WAAW+B,SAASrB,KAAKoB,CAAC,CAAC,kCAAmC;MAC/D,CAAC7B,kBAAkBQ,OAAOA,QAAS;MACnC,CAACZ,KACC6B,MAAM3B,eAAe;QACnBqB;QACAO,MAAMR;IACR,IACAS,UAAU,OACX;QACC,CAAClB,KAAKoB,CAAC,CAAC,8BAA8B;MACxC,EAAEjC,KAAK;IACT,EAAEwB;AAEN"}
|