Okta-react integration in AWS S3 bucket

Okta works fine in development side but when I deploy my react app in AWS S3 bucket and try static hosting, it is getting redirected to okta sign in page but after that it is returning a url “https://…/index.html/login/callback?code=…&state=…” which is not recognized by S3 bucket.
I am using okta react version 4.1.0.

I am getting the following error in S3 bucket-



<Message>The specified key does not exist.</Message>





I am getting the following error in the console-
Failed to load resource: the server responded with a status of 404 (Not Found)

Can anyone guide me through the steps of integrating Okta in a deployed react app in S3 bucket static hosting?