Skip to content

Commit

Permalink
printing request headers in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mohit2152sharma committed Dec 12, 2024
1 parent 15740a4 commit 6a58eb7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const handleAuth: Handle = async ({ event, resolve }) => {
}

event.locals.user = JSON.parse(sessionToken);
console.debug(`headers sent by client: ${event.request.headers}`);

// TODO: Reuse the following code for session management with database
// const { session, user } = await auth.validateSessionToken(sessionToken);
Expand Down
2 changes: 0 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ export function cn(...inputs: ClassValue[]) {
// overwritten by shadcn
export function handleLoginRedirect(event: RequestEvent) {
const redirectTo = event.url.pathname + event.url.search;
console.log(event);
console.log(redirectTo);
return `/login?redirectTo=${redirectTo}`;
}
3 changes: 0 additions & 3 deletions src/routes/home/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ export const actions = {
default: async (event: RequestEvent) => {
const formData = await event.request.formData();
const form = await superValidate(formData, zod(BskyContentSchema));
console.log(formData);
console.log(form);

if (form.valid) {
const parsedValues = BskyContentSchema.parse(form.data);
console.log('🪚 parsedValues:', parsedValues);

const sessionData = {
did: event.locals.user!.bskyDid,
Expand Down

0 comments on commit 6a58eb7

Please sign in to comment.