@@ -90,7 +90,7 @@ export async function loadJWKs(): Promise<Keyset | undefined> {
9090 // under a new variable and update here
9191 const jwkOne = useRuntimeConfig ( ) . oauthJwkOne
9292 if ( ! jwkOne ) {
93- if ( import . meta. test ) {
93+ if ( ! import . meta. test ) {
9494 // eslint-disable-next-line no-console
9595 console . error ( 'Failed to load JWKs (not set).' )
9696 }
@@ -100,14 +100,8 @@ export async function loadJWKs(): Promise<Keyset | undefined> {
100100 // For multiple keys if we need to rotate
101101 // const keys = await Promise.all([JoseKey.fromImportable(jwkOne)])
102102
103- try {
104- const keys = await JoseKey . fromImportable ( jwkOne )
105- return new Keyset ( [ keys ] )
106- } catch ( e ) {
107- // eslint-disable-next-line no-console
108- console . error ( 'Failed to load JWKs.' , e )
109- return undefined
110- }
103+ const keys = await JoseKey . fromImportable ( jwkOne )
104+ return new Keyset ( [ keys ] )
111105}
112106
113107async function getOAuthSession ( event : H3Event ) : Promise < {
@@ -123,7 +117,7 @@ async function getOAuthSession(event: H3Event): Promise<{
123117 return { oauthSession : undefined , serverSession }
124118 }
125119
126- const oauthSession = await event . context . oauthClient . restore ( currentSession . public . did )
120+ const oauthSession = await event . context . oauthClient ? .restore ( currentSession . public . did )
127121 return { oauthSession, serverSession }
128122 } catch ( error ) {
129123 // Log error safely without using util.inspect on potentially problematic objects
0 commit comments