mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-09-12 23:23:31 -06:00
feat: support 2fA
This commit is contained in:
@@ -4,6 +4,7 @@ import { sendToBackground } from "@plasmohq/messaging";
|
||||
export type BskyLoginParams = {
|
||||
identifier: string;
|
||||
password: string;
|
||||
authFactorToken?: string;
|
||||
};
|
||||
|
||||
export class BskyServiceWorkerClient {
|
||||
@@ -14,6 +15,7 @@ export class BskyServiceWorkerClient {
|
||||
public static async createAgent({
|
||||
identifier,
|
||||
password,
|
||||
authFactorToken,
|
||||
}: BskyLoginParams): Promise<BskyServiceWorkerClient> {
|
||||
const client = new BskyServiceWorkerClient();
|
||||
const { session, error } = await sendToBackground({
|
||||
@@ -21,6 +23,7 @@ export class BskyServiceWorkerClient {
|
||||
body: {
|
||||
identifier,
|
||||
password,
|
||||
...(authFactorToken && { authFactorToken: authFactorToken }),
|
||||
},
|
||||
});
|
||||
if (error) throw new Error(error.message);
|
||||
|
@@ -196,10 +196,12 @@ export const useRetrieveBskyUsers = () => {
|
||||
identifier,
|
||||
password,
|
||||
messageName,
|
||||
authFactorToken,
|
||||
}: {
|
||||
identifier: string;
|
||||
password: string;
|
||||
messageName: (typeof MESSAGE_NAMES)[keyof typeof MESSAGE_NAMES];
|
||||
authFactorToken?: string;
|
||||
}) => {
|
||||
setRetrievalParams({
|
||||
identifier,
|
||||
@@ -210,6 +212,7 @@ export const useRetrieveBskyUsers = () => {
|
||||
bskyClient.current = await BskyServiceWorkerClient.createAgent({
|
||||
identifier,
|
||||
password,
|
||||
...(authFactorToken && { authFactorToken: authFactorToken }),
|
||||
});
|
||||
|
||||
setActionMode(MESSAGE_NAME_TO_ACTION_MODE_MAP[messageName]);
|
||||
|
Reference in New Issue
Block a user