From b67ea29aff637475b1da1e5688177804a1f44497 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 18 Jul 2025 14:49:13 -0700 Subject: [PATCH] Better error --- plugins/auth-oauth2/src/grants/authorizationCode.ts | 2 +- plugins/auth-oauth2/src/grants/implicit.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/auth-oauth2/src/grants/authorizationCode.ts b/plugins/auth-oauth2/src/grants/authorizationCode.ts index 781cbaab..b1bdb2b3 100644 --- a/plugins/auth-oauth2/src/grants/authorizationCode.ts +++ b/plugins/auth-oauth2/src/grants/authorizationCode.ts @@ -56,7 +56,7 @@ export async function getAuthorizationCode( try { authorizationUrl = new URL(`${authorizationUrlRaw ?? ''}`); } catch { - throw new Error('Invalid authorization URL: ' + authorizationUrlRaw); + throw new Error(`Invalid authorization URL "${authorizationUrlRaw}"`); } authorizationUrl.searchParams.set('response_type', 'code'); authorizationUrl.searchParams.set('client_id', clientId); diff --git a/plugins/auth-oauth2/src/grants/implicit.ts b/plugins/auth-oauth2/src/grants/implicit.ts index 585f0589..625f255a 100644 --- a/plugins/auth-oauth2/src/grants/implicit.ts +++ b/plugins/auth-oauth2/src/grants/implicit.ts @@ -35,7 +35,7 @@ export async function getImplicit( try { authorizationUrl = new URL(`${authorizationUrlRaw ?? ''}`); } catch { - throw new Error('Invalid authorization URL: ' + authorizationUrlRaw); + throw new Error(`Invalid authorization URL "${authorizationUrlRaw}"`); } authorizationUrl.searchParams.set('response_type', 'token'); authorizationUrl.searchParams.set('client_id', clientId);