File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export function AccountMenu() {
4242 }
4343 } ;
4444
45- if ( isPending ) {
45+ if ( isPending || ! session ) {
4646 return < div className = "w-10 h-10 skeleton rounded-full" > </ div > ;
4747 }
4848
Original file line number Diff line number Diff line change @@ -37,11 +37,15 @@ async function initAll(ctx?: Partial<Context>): Promise<Context> {
3737 ctx . auth = await getAuthServer ( ctx . drizzle ) ;
3838 }
3939 if ( ! ctx . userId ) {
40- const session = await ctx . auth . api . getSession ( {
41- headers : await headers ( ) ,
42- } ) ;
43- if ( session ) {
44- ctx . userId = session . user . id ;
40+ try {
41+ const session = await ctx . auth . api . getSession ( {
42+ headers : await headers ( ) ,
43+ } ) ;
44+ if ( session ) {
45+ ctx . userId = session . user . id ;
46+ }
47+ } catch ( e ) {
48+ console . error ( "Failed to get session in initAll:" , e ) ;
4549 }
4650 }
4751 return ctx as Context ;
You can’t perform that action at this time.
0 commit comments