refactor: enhance logging in auth handler to include detailed response information for better debugging
This commit is contained in:
+12
-1
@@ -104,7 +104,18 @@ export const app = new Hono()
|
||||
const response = await auth.handler(request);
|
||||
|
||||
if (response.status >= 300 && response.status < 400) {
|
||||
console.log('[auth-handler]', c.req.method, c.req.path, '→', response.status, response.headers.get('location'));
|
||||
const location = response.headers.get('location') ?? '';
|
||||
const setCookies = response.headers.get('set-cookie') ?? '';
|
||||
console.log(
|
||||
'[auth-handler]',
|
||||
c.req.method,
|
||||
c.req.path,
|
||||
'→',
|
||||
response.status,
|
||||
`location.length=${location.length}`,
|
||||
`setCookie.length=${setCookies.length}`,
|
||||
`location[0..200]=${location.slice(0, 200)}`
|
||||
);
|
||||
}
|
||||
|
||||
return response;
|
||||
|
||||
@@ -274,7 +274,7 @@
|
||||
{#if !isLoaded}
|
||||
{#if $lessonVideoUpload.isUploading}
|
||||
<div
|
||||
class="border-primary-300 flex h-full w-full flex-col items-center justify-center rounded-xl border border-dashed"
|
||||
class="border-primary-300 flex h-full w-full flex-col items-center justify-center rounded-xl border border-dashed py-4"
|
||||
>
|
||||
<div class="flex w-full max-w-[500px] flex-col items-center gap-5 px-6 text-center">
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user