fix(cli): add Origin header to auth requests #115

Merged
jason.woltje merged 1 commits from fix/cli-auth-origin into main 2026-03-15 17:03:43 +00:00
Showing only changes of commit eab6cf51f9 - Show all commits

View File

@@ -29,7 +29,7 @@ export async function signIn(
): Promise<AuthResult> {
const res = await fetch(`${gatewayUrl}/api/auth/sign-in/email`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
headers: { 'Content-Type': 'application/json', Origin: gatewayUrl },
body: JSON.stringify({ email, password }),
redirect: 'manual',
});
@@ -106,7 +106,7 @@ export function loadSession(gatewayUrl: string): AuthResult | null {
export async function validateSession(gatewayUrl: string, cookie: string): Promise<boolean> {
try {
const res = await fetch(`${gatewayUrl}/api/auth/get-session`, {
headers: { Cookie: cookie },
headers: { Cookie: cookie, Origin: gatewayUrl },
});
return res.ok;
} catch {