diff options
author | 2024-07-09 21:11:13 +0100 | |
---|---|---|
committer | 2024-07-10 01:56:38 +0100 | |
commit | 0bf31556d7afc359ce0ebb145c962f224e547bd1 (patch) | |
tree | b76cffa1845fa5bbac13c2636f6f3ba6220de1a0 /src/components | |
parent | Add AuthorizationSplash to display above content when auth in progress (diff) |
Gracefully handle user cancelled authorization
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/OAuth2Button.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/OAuth2Button.tsx b/src/components/OAuth2Button.tsx index be8d160..67399ee 100644 --- a/src/components/OAuth2Button.tsx +++ b/src/components/OAuth2Button.tsx @@ -55,8 +55,10 @@ async function login(props: OAuth2ButtonProps, errorDialog: React.RefObject<HTML } // Propagate to sentry - reason.Error.stack = new Error(`OAuth: ${reason.Message}`).stack + "\n" + reason.Error.stack; - throw reason.Error; + if (reason.Error) { + reason.Error.stack = new Error(`OAuth: ${reason.Message}`).stack + "\n" + reason.Error.stack; + throw reason.Error; + } }); if (checkScopes(props.scopes) && props.rerender) { |