feat: cms feedback and customer management

This commit is contained in:
2026-02-09 20:02:52 +01:00
parent a306d24f51
commit 625c58398c
31 changed files with 18998 additions and 385 deletions

View File

@@ -49,13 +49,13 @@ export default async function LoginPage({ searchParams }: LoginPageProps) {
try {
const clientUsersRes = await fetch(
`${process.env.INFRA_DIRECTUS_URL}/items/client_users?filter[email][_eq]=${encodeURIComponent(
email
email,
)}&fields=*,company.*`,
{
headers: {
Authorization: `Bearer ${process.env.INFRA_DIRECTUS_TOKEN}`,
},
}
},
);
if (clientUsersRes.ok) {
@@ -63,7 +63,11 @@ export default async function LoginPage({ searchParams }: LoginPageProps) {
const clientUser = users[0];
// ⚠️ NOTE: Plain text check for demo/dev, should use argon2 in production
if (clientUser && clientUser.password === password) {
if (
clientUser &&
(clientUser.password === password ||
clientUser.temporary_password === password)
) {
userIdentity = clientUser.first_name || clientUser.email;
userCompany = {
id: clientUser.company?.id,
@@ -94,7 +98,7 @@ export default async function LoginPage({ searchParams }: LoginPageProps) {
`${process.env.DIRECTUS_URL}/users/me?fields=*,company.*`,
{
headers: { Authorization: `Bearer ${accessToken}` },
}
},
);
if (userRes.ok) {