Skip to content

Commit 8a07129

Browse files
committed
fix site
1 parent d06cd21 commit 8a07129

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

explorer-v2/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
"type": "module",
2424
"dependencies": {
2525
"@fontsource/fira-mono": "^4.2.2",
26-
"@lukeed/uuid": "^2.0.0",
27-
"cookie": "^0.4.1",
2826
"eslint": "^8.0.0",
2927
"eslint-plugin-svelte3": "^3.2.0",
3028
"eslint-scope": "^7.0.0",

explorer-v2/src/hooks.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
1-
import cookie from 'cookie';
2-
import { v4 as uuid } from '@lukeed/uuid';
3-
4-
export async function handle({ request, resolve }) {
5-
const cookies = cookie.parse(request.headers.cookie || '');
6-
request.locals.userid = cookies.userid || uuid();
7-
8-
const response = await resolve(request);
9-
10-
if (!cookies.userid) {
11-
// if this is the first time the user has visited this app,
12-
// set a cookie so that we recognise them when they return
13-
response.headers['set-cookie'] = cookie.serialize('userid', request.locals.userid, {
14-
path: '/',
15-
httpOnly: true
16-
});
17-
}
18-
1+
export async function handle({ event, resolve }) {
2+
const response = await resolve(event);
193
return response;
204
}

0 commit comments

Comments
 (0)