From 82096d339dd01ba6ae19eaf3a8a8fcab9d29a1fd Mon Sep 17 00:00:00 2001 From: kawamataryo Date: Fri, 25 Aug 2023 05:34:27 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20fixed=20to=20work=20even=20if=20@?= =?UTF-8?q?=20is=20in=20login=20handle=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/happy-crabs-unite.md | 5 +++++ src/lib/bskyClient.ts | 5 ++++- src/popup.tsx | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/happy-crabs-unite.md diff --git a/.changeset/happy-crabs-unite.md b/.changeset/happy-crabs-unite.md new file mode 100644 index 0000000..8f3bcb4 --- /dev/null +++ b/.changeset/happy-crabs-unite.md @@ -0,0 +1,5 @@ +--- +"sky-follower-bridge": patch +--- + +- fixed to work even if @ is in login handle name diff --git a/src/lib/bskyClient.ts b/src/lib/bskyClient.ts index 773e65f..f7f5a29 100644 --- a/src/lib/bskyClient.ts +++ b/src/lib/bskyClient.ts @@ -23,7 +23,10 @@ export class BskyClient { password, }: BskyLoginParams): Promise { const client = new BskyClient(); - const {data} = await client.agent.login({ identifier, password }); + const {data} = await client.agent.login({ + identifier: identifier.replace(/^@/, ""), // if identifier is a handle name, @ is not required + password + }); client.me = { did: data.did, handle: data.handle, diff --git a/src/popup.tsx b/src/popup.tsx index 34cef8d..ec7289f 100644 --- a/src/popup.tsx +++ b/src/popup.tsx @@ -133,7 +133,7 @@ function IndexPopup() { setUserId(e.target.value)} className="input input-bordered input-sm w-full max-w-xs"