Files
klz-cables.com/.pnpm-store/v10/files/6c/787672f9cd44591b858a337ee7ccef557eb806772861b67e49b6a050cd2888d93f4c24d26cfe4dd12e025e9d3314a83e9a57f8909f40890a81740397edfb9c
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

95 lines
2.6 KiB
Plaintext

import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import { redirect } from 'next/navigation.js';
import { getSafeRedirect } from 'payload/shared';
import React, { Fragment } from 'react';
import { Logo } from '../../elements/Logo/index.js';
import { LoginForm } from './LoginForm/index.js';
export const loginBaseClass = 'login';
export function LoginView({
initPageResult,
params,
searchParams
}) {
const {
locale,
permissions,
req
} = initPageResult;
const {
i18n,
payload: {
config
},
payload,
user
} = req;
const {
admin: {
components: {
afterLogin,
beforeLogin
} = {},
user: userSlug
},
routes: {
admin
}
} = config;
const redirectUrl = getSafeRedirect({
fallbackTo: admin,
redirectTo: searchParams.redirect
});
if (user) {
redirect(redirectUrl);
}
const collectionConfig = payload?.collections?.[userSlug]?.config;
const prefillAutoLogin = typeof config.admin?.autoLogin === 'object' && config.admin?.autoLogin.prefillOnly;
const prefillUsername = prefillAutoLogin && typeof config.admin?.autoLogin === 'object' ? config.admin?.autoLogin.username : undefined;
const prefillEmail = prefillAutoLogin && typeof config.admin?.autoLogin === 'object' ? config.admin?.autoLogin.email : undefined;
const prefillPassword = prefillAutoLogin && typeof config.admin?.autoLogin === 'object' ? config.admin?.autoLogin.password : undefined;
return /*#__PURE__*/_jsxs(Fragment, {
children: [/*#__PURE__*/_jsx("div", {
className: `${loginBaseClass}__brand`,
children: /*#__PURE__*/_jsx(Logo, {
i18n: i18n,
locale: locale,
params: params,
payload: payload,
permissions: permissions,
searchParams: searchParams,
user: user
})
}), RenderServerComponent({
Component: beforeLogin,
importMap: payload.importMap,
serverProps: {
i18n,
locale,
params,
payload,
permissions,
searchParams,
user
}
}), !collectionConfig?.auth?.disableLocalStrategy && /*#__PURE__*/_jsx(LoginForm, {
prefillEmail: prefillEmail,
prefillPassword: prefillPassword,
prefillUsername: prefillUsername,
searchParams: searchParams
}), RenderServerComponent({
Component: afterLogin,
importMap: payload.importMap,
serverProps: {
i18n,
locale,
params,
payload,
permissions,
searchParams,
user
}
})]
});
}
//# sourceMappingURL=index.js.map