File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -144,14 +144,23 @@ const startServer = async () => {
144144 instance . addHook ( 'onRequest' , async ( req ) => {
145145 if ( req . cookies ?. session ) {
146146 try {
147- const sessionId = decodeSessionToken ( req . cookies . session ) ;
147+ const sessionId = decodeSessionToken ( req . cookies ? .session ) ;
148148 const session = await runWithAlsSession ( sessionId , ( ) =>
149149 validateSessionToken ( req . cookies . session ) ,
150150 ) ;
151151 req . session = session ;
152152 } catch ( e ) {
153153 req . session = EMPTY_SESSION ;
154154 }
155+ } else if ( process . env . DEMO_USER_ID ) {
156+ try {
157+ const session = await runWithAlsSession ( '1' , ( ) =>
158+ validateSessionToken ( null ) ,
159+ ) ;
160+ req . session = session ;
161+ } catch ( e ) {
162+ req . session = EMPTY_SESSION ;
163+ }
155164 } else {
156165 req . session = EMPTY_SESSION ;
157166 }
You can’t perform that action at this time.
0 commit comments