File tree Expand file tree Collapse file tree 2 files changed +2
-20
lines changed Expand file tree Collapse file tree 2 files changed +2
-20
lines changed Original file line number Diff line number Diff line change 23
23
"type" : " module" ,
24
24
"dependencies" : {
25
25
"@fontsource/fira-mono" : " ^4.2.2" ,
26
- "@lukeed/uuid" : " ^2.0.0" ,
27
- "cookie" : " ^0.4.1" ,
28
26
"eslint" : " ^8.0.0" ,
29
27
"eslint-plugin-svelte3" : " ^3.2.0" ,
30
28
"eslint-scope" : " ^7.0.0" ,
Original file line number Diff line number Diff line change 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 ) ;
19
3
return response ;
20
4
}
You can’t perform that action at this time.
0 commit comments