Skip to content

Commit

Permalink
Handling 'LoginEnterAlternateIdentifierSubtask'
Browse files Browse the repository at this point in the history
  • Loading branch information
wik3d committed Jun 26, 2024
1 parent 989b36e commit bd98918
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/auth-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit bd98918

Please sign in to comment.