Skip to content

Commit

Permalink
chore: Add tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Brayan-724 committed Sep 14, 2024
1 parent 7300a88 commit 0a95d41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/routes/form/[slug]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export async function load(
console.log(`Loading form ${params.slug} from: ${FORM_URL}`);
const form_res = await fetch(FORM_URL);
const form = await form_res.json() as ApiResponse<Form>;
console.log("Form loaded:", form);

if (form.success) {
const code = cookies.get("external-code");
console.log("User has code: ", !!code)

if (form.data.require_login && !code) {
return {
Expand All @@ -31,6 +33,7 @@ export async function load(
};
}

console.log(`Loading session from: ${FORM_URL}/session`);
const session_res = await fetch(`${FORM_URL}/session`, {
headers: code
? {
Expand All @@ -40,6 +43,7 @@ export async function load(
});

const session = await session_res.json() as ApiResponse<string>;
console.log("Session loaded:", session);

if (session.success) {
const user = session.data!;
Expand Down

0 comments on commit 0a95d41

Please sign in to comment.