mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-09-12 23:23:31 -06:00
✨ support 2FA auth
This commit is contained in:
@@ -6,6 +6,7 @@ const clientCache = new Map<string, BskyClient>();
|
||||
export type BskyLoginParams = {
|
||||
identifier: string;
|
||||
password: string;
|
||||
authFactorToken?: string;
|
||||
};
|
||||
|
||||
export class BskyClient {
|
||||
@@ -49,11 +50,13 @@ export class BskyClient {
|
||||
public static async createAgent({
|
||||
identifier,
|
||||
password,
|
||||
authFactorToken,
|
||||
}: BskyLoginParams): Promise<BskyClient> {
|
||||
const client = new BskyClient();
|
||||
const { data } = await client.agent.login({
|
||||
identifier,
|
||||
password,
|
||||
...(authFactorToken && { authFactorToken }),
|
||||
});
|
||||
client.me = {
|
||||
did: data.did,
|
||||
|
@@ -73,3 +73,5 @@ export const MATCH_TYPE_LABEL_AND_COLOR = {
|
||||
color: "secondary",
|
||||
},
|
||||
};
|
||||
|
||||
export const AUTH_FACTOR_TOKEN_REQUIRED_ERROR_MESSAGE = "AuthFactorTokenRequiredError";
|
||||
|
Reference in New Issue
Block a user