From bd98918eb5efba9b02c7d83d235fa659f6b0ad72 Mon Sep 17 00:00:00 2001 From: Wik3d <61479652+wik3d@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:39:20 +0100 Subject: [PATCH] Handling 'LoginEnterAlternateIdentifierSubtask' --- src/auth-user.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/auth-user.ts b/src/auth-user.ts index c02f2eee..9c3d9819 100644 --- a/src/auth-user.ts +++ b/src/auth-user.ts @@ -84,6 +84,13 @@ export class TwitterUserAuth extends TwitterGuestAuth { next = await this.handleJsInstrumentationSubtask(next); } else if (next.subtask.subtask_id === 'LoginEnterUserIdentifierSSO') { next = await this.handleEnterUserIdentifierSSO(next, username); + } else if ( + next.subtask.subtask_id === 'LoginEnterAlternateIdentifierSubtask' + ) { + next = await this.handleEnterAlternateIdentifierSubtask( + next, + email as string, + ); } else if (next.subtask.subtask_id === 'LoginEnterPassword') { next = await this.handleEnterPassword(next, password); } else if (next.subtask.subtask_id === 'AccountDuplicationCheck') { @@ -166,6 +173,24 @@ export class TwitterUserAuth extends TwitterGuestAuth { }); } + private async handleEnterAlternateIdentifierSubtask( + prev: FlowTokenResultSuccess, + email: string, + ) { + return await this.executeFlowTask({ + flow_token: prev.flowToken, + subtask_inputs: [ + { + subtask_id: 'LoginEnterAlternateIdentifierSubtask', + enter_text: { + text: email, + link: 'next_link', + }, + }, + ], + }); + } + private async handleEnterUserIdentifierSSO( prev: FlowTokenResultSuccess, username: string,