fixed to work even if @ is in login handle name

This commit is contained in:
kawamataryo 2023-08-25 05:34:27 +09:00
parent c4bd79ad90
commit 82096d339d
3 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"sky-follower-bridge": patch
---
- fixed to work even if @ is in login handle name

View File

@ -23,7 +23,10 @@ export class BskyClient {
password, password,
}: BskyLoginParams): Promise<BskyClient> { }: BskyLoginParams): Promise<BskyClient> {
const client = new BskyClient(); 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 = { client.me = {
did: data.did, did: data.did,
handle: data.handle, handle: data.handle,

View File

@ -133,7 +133,7 @@ function IndexPopup() {
</span> </span>
<input <input
type="text" type="text"
placeholder="Bluesky login email or handle(without @)" placeholder="Bluesky handle or login email"
value={userId} value={userId}
onChange={(e) => setUserId(e.target.value)} onChange={(e) => setUserId(e.target.value)}
className="input input-bordered input-sm w-full max-w-xs" className="input input-bordered input-sm w-full max-w-xs"