mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-04-17 17:22:23 -06:00
commit
e9f8d3de46
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "sky-follower-bridge",
|
"name": "sky-follower-bridge",
|
||||||
"displayName": "Sky Follower Bridge",
|
"displayName": "Sky Follower Bridge",
|
||||||
"version": "0.9.4",
|
"version": "0.9.5",
|
||||||
"description": "Instantly find and follow the same users from your Twitter follows on Bluesky.",
|
"description": "Instantly find and follow the same users from your Twitter follows on Bluesky.",
|
||||||
"author": "kawamataryou",
|
"author": "kawamataryou",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -46,6 +46,7 @@ const App = () => {
|
|||||||
body: {
|
body: {
|
||||||
identifier: string;
|
identifier: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
authFactorToken?: string;
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
_sender: chrome.runtime.MessageSender,
|
_sender: chrome.runtime.MessageSender,
|
||||||
@ -56,6 +57,9 @@ const App = () => {
|
|||||||
identifier: message.body.identifier,
|
identifier: message.body.identifier,
|
||||||
password: message.body.password,
|
password: message.body.password,
|
||||||
messageName: message.name,
|
messageName: message.name,
|
||||||
|
...(message.body.authFactorToken && {
|
||||||
|
authFactorToken: message.body.authFactorToken,
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
sendResponse({ hasError: false });
|
sendResponse({ hasError: false });
|
||||||
|
@ -4,6 +4,7 @@ import { sendToBackground } from "@plasmohq/messaging";
|
|||||||
export type BskyLoginParams = {
|
export type BskyLoginParams = {
|
||||||
identifier: string;
|
identifier: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
authFactorToken?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export class BskyServiceWorkerClient {
|
export class BskyServiceWorkerClient {
|
||||||
@ -14,6 +15,7 @@ export class BskyServiceWorkerClient {
|
|||||||
public static async createAgent({
|
public static async createAgent({
|
||||||
identifier,
|
identifier,
|
||||||
password,
|
password,
|
||||||
|
authFactorToken,
|
||||||
}: BskyLoginParams): Promise<BskyServiceWorkerClient> {
|
}: BskyLoginParams): Promise<BskyServiceWorkerClient> {
|
||||||
const client = new BskyServiceWorkerClient();
|
const client = new BskyServiceWorkerClient();
|
||||||
const { session, error } = await sendToBackground({
|
const { session, error } = await sendToBackground({
|
||||||
@ -21,6 +23,7 @@ export class BskyServiceWorkerClient {
|
|||||||
body: {
|
body: {
|
||||||
identifier,
|
identifier,
|
||||||
password,
|
password,
|
||||||
|
...(authFactorToken && { authFactorToken: authFactorToken }),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (error) throw new Error(error.message);
|
if (error) throw new Error(error.message);
|
||||||
|
@ -196,10 +196,12 @@ export const useRetrieveBskyUsers = () => {
|
|||||||
identifier,
|
identifier,
|
||||||
password,
|
password,
|
||||||
messageName,
|
messageName,
|
||||||
|
authFactorToken,
|
||||||
}: {
|
}: {
|
||||||
identifier: string;
|
identifier: string;
|
||||||
password: string;
|
password: string;
|
||||||
messageName: (typeof MESSAGE_NAMES)[keyof typeof MESSAGE_NAMES];
|
messageName: (typeof MESSAGE_NAMES)[keyof typeof MESSAGE_NAMES];
|
||||||
|
authFactorToken?: string;
|
||||||
}) => {
|
}) => {
|
||||||
setRetrievalParams({
|
setRetrievalParams({
|
||||||
identifier,
|
identifier,
|
||||||
@ -210,6 +212,7 @@ export const useRetrieveBskyUsers = () => {
|
|||||||
bskyClient.current = await BskyServiceWorkerClient.createAgent({
|
bskyClient.current = await BskyServiceWorkerClient.createAgent({
|
||||||
identifier,
|
identifier,
|
||||||
password,
|
password,
|
||||||
|
...(authFactorToken && { authFactorToken: authFactorToken }),
|
||||||
});
|
});
|
||||||
|
|
||||||
setActionMode(MESSAGE_NAME_TO_ACTION_MODE_MAP[messageName]);
|
setActionMode(MESSAGE_NAME_TO_ACTION_MODE_MAP[messageName]);
|
||||||
|
@ -109,7 +109,7 @@ function IndexPopup() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (res.hasError) {
|
if (res.hasError) {
|
||||||
if (res.message === AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE) {
|
if (res.message.includes(AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE)) {
|
||||||
setIsShowAuthFactorTokenInput(true);
|
setIsShowAuthFactorTokenInput(true);
|
||||||
} else {
|
} else {
|
||||||
setErrorMessage(res.message);
|
setErrorMessage(res.message);
|
||||||
@ -130,7 +130,6 @@ function IndexPopup() {
|
|||||||
setErrorMessage(
|
setErrorMessage(
|
||||||
"Error: Something went wrong. Please reload the web page and try again.",
|
"Error: Something went wrong. Please reload the web page and try again.",
|
||||||
);
|
);
|
||||||
console.error(e);
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user