From a377ee33293aed0d609ff1d1af2692110f50445c Mon Sep 17 00:00:00 2001 From: Kuba Suder Date: Mon, 20 May 2024 03:21:24 +0200 Subject: [PATCH] allow login handle to be entered with @ --- skythread.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/skythread.js b/skythread.js index 122d41e..285dbf6 100644 --- a/skythread.js +++ b/skythread.js @@ -249,11 +249,12 @@ async function logIn(identifier, password) { pdsEndpoint = await Minisky.pdsEndpointForDid(identifier); } else if (identifier.match(/^[^@]+@[^@]+$/)) { pdsEndpoint = 'bsky.social'; - } else if (identifier.match(/^[\w\-]+(\.[\w\-]+)+$/)) { + } else if (identifier.match(/^@?[\w\-]+(\.[\w\-]+)+$/)) { + identifier = identifier.replace(/^@/, ''); let did = await appView.resolveHandle(identifier); pdsEndpoint = await Minisky.pdsEndpointForDid(did); } else { - throw 'Please enter your handle or DID'; + throw 'Please enter your handle or DID.'; } let pds = new BlueskyAPI(pdsEndpoint, true); -- 2.51.2