Skip to content

Commit

Permalink
Merge pull request #110 from jimduchek/onerror-with-exchange-fn
Browse files Browse the repository at this point in the history
Call onError when exchangeCodeForTokenQuery... has error.
  • Loading branch information
tasoskakour authored Mar 25, 2024
2 parents 2d8be06 + 86256d6 commit 49261da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/use-oauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const useOAuth2 = <TData = TAuthTokenPayload>(props: TOauth2Props<TData>)
loading: false,
error: genericError.toString(),
});
if (onError) await onError(genericError.toString());
} finally {
// Clear stuff ...
cleanup(intervalRef, popupRef, handleMessageListener);
Expand Down

0 comments on commit 49261da

Please # to comment.