from the job title I assume you need a authentication code in react or javascript base page with 2FA using AWS Cognito to get the SMS code. I know this solution, and did it multiple times. I am AWS solution architect with 5x certified.
let's chat for more details