From 2f874631701fb2948c734f8293b3338408bcfd0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Mon, 30 Oct 2023 19:22:30 +0200 Subject: [PATCH] fix(server): better fix for the OAuth Discovery errors (#4695) * fix(server/oauth): Handle errors from OAuth Discovery. * fix(server/oauth): Better fix for OAuth discovery error. * This doesn't break tests. * Update server/tsconfig.json Co-authored-by: Jason Rasmussen * Revert back to the mostly original way. --------- Co-authored-by: Jason Rasmussen --- server/src/domain/auth/auth.service.ts | 4 ++-- server/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/domain/auth/auth.service.ts b/server/src/domain/auth/auth.service.ts index 13c69d6b7..1b7a4037a 100644 --- a/server/src/domain/auth/auth.service.ts +++ b/server/src/domain/auth/auth.service.ts @@ -345,8 +345,8 @@ export class AuthService { } return new issuer.Client(metadata); - } catch (error: Error | any) { - this.logger.error(`Error in OAuth discovery: ${error}`, error?.stack); + } catch (error: any | AggregateError) { + this.logger.error(`Error in OAuth discovery: ${error}`, error?.stack, error?.errors); throw new InternalServerErrorException(`Error in OAuth discovery: ${error}`, { cause: error }); } } diff --git a/server/tsconfig.json b/server/tsconfig.json index cd7b3f1b9..d86cba04c 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -8,7 +8,7 @@ "experimentalDecorators": true, "allowSyntheticDefaultImports": true, "resolveJsonModule": true, - "target": "es2017", + "target": "es2021", "moduleResolution": "node16", "sourceMap": true, "outDir": "./dist",