From 86256d683200c763937f8067e3d00591233c9a56 Mon Sep 17 00:00:00 2001 From: Jim Duchek Date: Sun, 24 Mar 2024 14:25:24 -0600 Subject: [PATCH] Call onError when exchangeCodeForTokenQuery... has error. --- src/components/use-oauth2.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/use-oauth2.ts b/src/components/use-oauth2.ts index b52a517..76b2502 100644 --- a/src/components/use-oauth2.ts +++ b/src/components/use-oauth2.ts @@ -133,6 +133,7 @@ export const useOAuth2 = (props: TOauth2Props) loading: false, error: genericError.toString(), }); + if (onError) await onError(genericError.toString()); } finally { // Clear stuff ... cleanup(intervalRef, popupRef, handleMessageListener);