From 208ef56da63af362a6f0f80f56129b42a1bbb811 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 18 Mar 2022 17:03:30 -0500 Subject: remove a bunch of console.logs --- src/hooks.ts | 14 -------------- src/routes/loggedin.ts | 1 - src/routes/logout.ts | 2 -- src/routes/profile/update.ts | 13 ------------- src/routes/verify.svelte | 1 - src/routes/verify.ts | 1 - 6 files changed, 32 deletions(-) (limited to 'src') diff --git a/src/hooks.ts b/src/hooks.ts index ac53658..64c1b9d 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -7,25 +7,11 @@ if (!SKYBLOCK_STATS_API_KEY) export const handle: Handle = async ({ event, resolve }) => { const cookies = cookie.parse(event.request.headers.get('cookie') || '') - // event.locals.userid = cookies.userid || uuid(); - console.log(cookies) event.locals.sid = cookies.sid const response = await resolve(event) - // if (!cookies.userid) { - // // if this is the first time the user has visited this app, - // // set a cookie so that we recognise them when they return - // response.headers.set( - // 'set-cookie', - // cookie.serialize('userid', event.locals.userid, { - // path: '/', - // httpOnly: true - // }) - // ); - // } - return response } diff --git a/src/routes/loggedin.ts b/src/routes/loggedin.ts index 32dd6eb..10e8a24 100644 --- a/src/routes/loggedin.ts +++ b/src/routes/loggedin.ts @@ -19,7 +19,6 @@ export const get: RequestHandler = async ({ url }) => { throw new Error(res.statusText) return res.json() }) - console.log(response) if (response.ok) { return { diff --git a/src/routes/logout.ts b/src/routes/logout.ts index f2f5e33..19bd02b 100644 --- a/src/routes/logout.ts +++ b/src/routes/logout.ts @@ -7,9 +7,7 @@ if (!DISCORD_CLIENT_ID) export const get: RequestHandler = async ({ request, params, locals, url }) => { // if the sid is wrong, nothing to do - console.log(url.searchParams.get('sid'), locals.sid) if (url.searchParams.has('sid') && url.searchParams.get('sid') === locals.sid) { - console.log('ok sent logout') await fetch(`${API_URL}accounts/session`, { method: 'DELETE', headers: { diff --git a/src/routes/profile/update.ts b/src/routes/profile/update.ts index b906810..3bd6e57 100644 --- a/src/routes/profile/update.ts +++ b/src/routes/profile/update.ts @@ -13,13 +13,7 @@ function isValidEmoji(emoji: string) { return match && match[0] === emoji && match.index === 0 } -console.log(isValidEmoji('😎')) -console.log(isValidEmoji('😎')) -console.log(isValidEmoji('😎')) -console.log(isValidEmoji('😎')) - export const patch: RequestHandler = async ({ request, locals }) => { - console.log('updating profile...') if (locals.sid === undefined) { return { body: { ok: false, error: 'You are not logged in.' }, @@ -34,7 +28,6 @@ export const patch: RequestHandler = async ({ request, locals }) => { } const data = await request.json() - console.log('sending request to get session') const sessionResponse: { session: SessionSchema | null, account: AccountSchema | null } = await fetch(`${API_URL}accounts/session`, { method: 'POST', headers: { @@ -56,7 +49,6 @@ export const patch: RequestHandler = async ({ request, locals }) => { const emoji = data.emoji const isDonator = donators.find(d => d.uuid === sessionResponse.account?.minecraftUuid) !== undefined - console.log(sessionResponse.account?.minecraftUuid) const isAdmin = admins.includes(sessionResponse.account?.minecraftUuid) if (typeof backgroundName !== 'undefined' && typeof backgroundName !== 'string') { @@ -77,9 +69,7 @@ export const patch: RequestHandler = async ({ request, locals }) => { status: 400, } } - console.log('emoji', emoji) if (typeof emoji !== 'undefined' && typeof emoji !== 'string') { - console.log('a') return { body: { ok: false, error: 'Invalid emoji.' }, status: 400, @@ -94,7 +84,6 @@ export const patch: RequestHandler = async ({ request, locals }) => { } const backgroundUrl = backgroundName ? `/backgrounds/${backgroundName}` : undefined - console.log('emoji?', emoji) if (emoji) { if (!isDonator && !isAdmin) return { @@ -127,8 +116,6 @@ export const patch: RequestHandler = async ({ request, locals }) => { body: JSON.stringify(updatedAccount), }).then(r => r.json()) - console.log(response) - return { body: { ok: true } as JSONValue, diff --git a/src/routes/verify.svelte b/src/routes/verify.svelte index 9675779..20de403 100644 --- a/src/routes/verify.svelte +++ b/src/routes/verify.svelte @@ -1,7 +1,6 @@