diff options
author | mat <github@matdoes.dev> | 2022-03-18 17:03:30 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-18 17:03:30 -0500 |
commit | 208ef56da63af362a6f0f80f56129b42a1bbb811 (patch) | |
tree | 4c50c9a328f4c5c10b0b937ae0d501e6f99d4893 | |
parent | 5c9ccb3ab759526e84079f1c49abb87c995c7021 (diff) | |
download | skyblock-stats-208ef56da63af362a6f0f80f56129b42a1bbb811.tar.gz skyblock-stats-208ef56da63af362a6f0f80f56129b42a1bbb811.tar.bz2 skyblock-stats-208ef56da63af362a6f0f80f56129b42a1bbb811.zip |
remove a bunch of console.logs
-rw-r--r-- | src/hooks.ts | 14 | ||||
-rw-r--r-- | src/routes/loggedin.ts | 1 | ||||
-rw-r--r-- | src/routes/logout.ts | 2 | ||||
-rw-r--r-- | src/routes/profile/update.ts | 13 | ||||
-rw-r--r-- | src/routes/verify.svelte | 1 | ||||
-rw-r--r-- | src/routes/verify.ts | 1 |
6 files changed, 0 insertions, 32 deletions
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 @@ <script lang="ts" context="module"> import type { Load } from '@sveltejs/kit' export const load: Load = async ({ session, url }) => { - console.log(session.sid) if (session.sid === undefined) { return { redirect: '/login', status: 303 } } diff --git a/src/routes/verify.ts b/src/routes/verify.ts index a6a21d7..132b094 100644 --- a/src/routes/verify.ts +++ b/src/routes/verify.ts @@ -12,7 +12,6 @@ function redirect(status: number, location: string) { } export const post: RequestHandler = async ({ request, locals }) => { - console.log('verify', locals.sid) if (!process.env.SKYBLOCK_STATS_API_KEY) { return redirect(303, `/verify?error=NO_KEY`) } |