Merge branch 'dev' into clients-pops

This commit is contained in:
miloschwartz
2025-06-19 16:34:06 -04:00
20 changed files with 14219 additions and 14178 deletions

View File

@@ -42,6 +42,7 @@ export default function StepperForm() {
const [loading, setLoading] = useState(false);
const [isChecked, setIsChecked] = useState(false);
const [error, setError] = useState<string | null>(null);
const [orgCreated, setOrgCreated] = useState(false);
const orgSchema = z.object({
orgName: z.string().min(1, { message: t('orgNameRequired') }),
@@ -83,7 +84,7 @@ export default function StepperForm() {
};
const checkOrgIdAvailability = useCallback(async (value: string) => {
if (loading) {
if (loading || orgCreated) {
return;
}
try {
@@ -96,7 +97,7 @@ export default function StepperForm() {
} catch (error) {
setOrgIdTaken(false);
}
}, []);
}, [loading, orgCreated, api]);
const debouncedCheckOrgIdAvailability = useCallback(
debounce(checkOrgIdAvailability, 300),
@@ -129,7 +130,7 @@ export default function StepperForm() {
});
if (res && res.status === 201) {
// setCurrentStep("site");
setOrgCreated(true);
router.push(`/${values.orgId}/settings/sites/create`);
}
} catch (e) {

View File

@@ -78,15 +78,17 @@ export function Layout({
}
if (lightOrDark === "light") {
return "/logo/word_mark_black.png";
// return "/logo/word_mark_black.png";
return "/logo/pangolin_orange.svg";
}
return "/logo/word_mark_white.png";
// return "/logo/word_mark_white.png";
return "/logo/pangolin_orange.svg";
}
setPath(getPath());
}, [theme, env]);
const t = useTranslations();
return (
@@ -170,8 +172,8 @@ export function Layout({
<Image
src={path}
alt="Pangolin Logo"
width={110}
height={25}
width={35}
height={35}
priority={true}
quality={25}
/>

View File

@@ -1,4 +1,4 @@
import { cookies } from "next/headers";
import { cookies, headers } from "next/headers";
import { pullEnv } from "../pullEnv";
export async function authCookieHeader() {
@@ -7,9 +7,16 @@ export async function authCookieHeader() {
const allCookies = await cookies();
const cookieName = env.server.sessionCookieName;
const sessionId = allCookies.get(cookieName)?.value ?? null;
// all other headers
// this is needed to pass through x-forwarded-for, x-forwarded-proto, etc.
const otherHeaders = await headers();
const otherHeadersObject = Object.fromEntries(otherHeaders.entries());
return {
headers: {
Cookie: `${cookieName}=${sessionId}`,
...otherHeadersObject
},
};
}