From 74fbb4797922cfba654ad597803dfdd57598ae8d Mon Sep 17 00:00:00 2001 From: Ollie H Date: Mon, 1 May 2023 21:29:13 -0700 Subject: [PATCH] Strip whitespaces from tokens (#558) --- src/view/com/auth/login/Login.tsx | 3 ++- src/view/com/modals/DeleteAccount.tsx | 4 +++- 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 37558fb546..cec08192c2 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 f1febc2eab..724cefee8a 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')