aboutsummaryrefslogtreecommitdiff
path: root/src/hooks.ts
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-03-16 13:12:48 -0500
committermat <github@matdoes.dev>2022-03-16 13:12:48 -0500
commite6be291bd6787199f644b263c28c6d2c8b9b1d74 (patch)
tree7f9671882fdc24498a63460dfc7618d78b615b63 /src/hooks.ts
parentf4e0719c4c9b3d4ba9be725700d47e6d229928f4 (diff)
downloadskyblock-stats-e6be291bd6787199f644b263c28c6d2c8b9b1d74.tar.gz
skyblock-stats-e6be291bd6787199f644b263c28c6d2c8b9b1d74.tar.bz2
skyblock-stats-e6be291bd6787199f644b263c28c6d2c8b9b1d74.zip
Fix styling issues and add /login route
Diffstat (limited to 'src/hooks.ts')
-rw-r--r--src/hooks.ts38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/hooks.ts b/src/hooks.ts
index d767555..9cd6ca4 100644
--- a/src/hooks.ts
+++ b/src/hooks.ts
@@ -1,24 +1,24 @@
-import cookie from 'cookie';
-import { v4 as uuid } from '@lukeed/uuid';
-import type { Handle } from '@sveltejs/kit';
+import cookie from 'cookie'
+import { v4 as uuid } from '@lukeed/uuid'
+import type { Handle } from '@sveltejs/kit'
export const handle: Handle = async ({ event, resolve }) => {
- const cookies = cookie.parse(event.request.headers.get('cookie') || '');
- event.locals.userid = cookies.userid || uuid();
+ // const cookies = cookie.parse(event.request.headers.get('cookie') || '');
+ // event.locals.userid = cookies.userid || uuid();
- const response = await resolve(event);
+ 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
- })
- );
- }
+ // 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;
-};
+ return response
+}