about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorOllie H <renahlee@outlook.com>2023-05-01 21:29:13 -0700
committerGitHub <noreply@github.com>2023-05-01 23:29:13 -0500
commit74fbb4797922cfba654ad597803dfdd57598ae8d (patch)
tree190e44f8e3ed0c3f8cdf5413ad1da82a684d3665 /src
parent83959c595d52ceb7aa4e3f68441c5ac41c389ebc (diff)
downloadvoidsky-74fbb4797922cfba654ad597803dfdd57598ae8d.tar.zst
Strip whitespaces from tokens (#558)
Diffstat (limited to 'src')
-rw-r--r--src/view/com/auth/login/Login.tsx3
-rw-r--r--src/view/com/modals/DeleteAccount.tsx4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/view/com/auth/login/Login.tsx b/src/view/com/auth/login/Login.tsx
index 37558fb54..cec08192c 100644
--- a/src/view/com/auth/login/Login.tsx
+++ b/src/view/com/auth/login/Login.tsx
@@ -704,8 +704,9 @@ const SetNewPasswordForm = ({
 
     try {
       const agent = new BskyAgent({service: serviceUrl})
+      const token = resetCode.replace(/\s/g, '')
       await agent.com.atproto.server.resetPassword({
-        token: resetCode,
+        token,
         password,
       })
       onPasswordSet()
diff --git a/src/view/com/modals/DeleteAccount.tsx b/src/view/com/modals/DeleteAccount.tsx
index f1febc2ea..724cefee8 100644
--- a/src/view/com/modals/DeleteAccount.tsx
+++ b/src/view/com/modals/DeleteAccount.tsx
@@ -42,11 +42,13 @@ export function Component({}: {}) {
   const onPressConfirmDelete = async () => {
     setError('')
     setIsProcessing(true)
+    const token = confirmCode.replace(/\s/g, '')
+
     try {
       await store.agent.com.atproto.server.deleteAccount({
         did: store.me.did,
         password,
-        token: confirmCode,
+        token,
       })
       Toast.show('Your account has been deleted')
       resetToTab('HomeTab')