about summary refs log tree commit diff
path: root/src/screens/Signup/StepCaptcha/CaptchaWebView.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-05-01 01:08:59 -0700
committerGitHub <noreply@github.com>2024-05-01 01:08:59 -0700
commitb8d8bec388744c95aa84c955849d2bced45daf11 (patch)
tree987435632fae8bbfea56c935e6d55021356b636a /src/screens/Signup/StepCaptcha/CaptchaWebView.tsx
parent81ae7e425dc52846c5d4c282a0422a3875d84e2f (diff)
downloadvoidsky-b8d8bec388744c95aa84c955849d2bced45daf11.tar.zst
sentry errors for captcha web views and registration attempts (#3761)
* sentry errors for captcha web views

* include handles with errors

* log all registration request failures

* rm

* use a better trigger for web captcha errors

* add another trigger for recording a possible signup error

* unknown error type

* don't needlessly log on href errors

* honestly i probably cant always do a captcha in 20 seconds

* rm log

* timeout on back

* remove unnecessary colons
Diffstat (limited to 'src/screens/Signup/StepCaptcha/CaptchaWebView.tsx')
-rw-r--r--src/screens/Signup/StepCaptcha/CaptchaWebView.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/screens/Signup/StepCaptcha/CaptchaWebView.tsx b/src/screens/Signup/StepCaptcha/CaptchaWebView.tsx
index 50918c4ce..caa0aa28a 100644
--- a/src/screens/Signup/StepCaptcha/CaptchaWebView.tsx
+++ b/src/screens/Signup/StepCaptcha/CaptchaWebView.tsx
@@ -26,7 +26,7 @@ export function CaptchaWebView({
   stateParam: string
   state?: SignupState
   onSuccess: (code: string) => void
-  onError: () => void
+  onError: (error: unknown) => void
 }) {
   const redirectHost = React.useMemo(() => {
     if (!state?.serviceUrl) return 'bsky.app'
@@ -56,7 +56,7 @@ export function CaptchaWebView({
 
       const code = urlp.searchParams.get('code')
       if (urlp.searchParams.get('state') !== stateParam || !code) {
-        onError()
+        onError({error: 'Invalid state or code'})
         return
       }
 
@@ -74,6 +74,12 @@ export function CaptchaWebView({
       onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
       onNavigationStateChange={onNavigationStateChange}
       scrollEnabled={false}
+      onError={e => {
+        onError(e.nativeEvent)
+      }}
+      onHttpError={e => {
+        onError(e.nativeEvent)
+      }}
     />
   )
 }