I would like to know how I can implement "login only after payment" functionality using Firebase authentication and Firestore:
- user clicks on a link on my website, redirecting them to some payment page (could be PayPal or stripe for example).
- on the payment page, user fills the payment details and presses "submit"
- user is billed, the payment acceptance platform then calls the successUrl which was pre set to some cloud function end point.
- the cloud function executes and perform the following: 4.1) generates some strong password. 4.2) sends a link with the strong password to the paying user ("this is your initial password, enter the following link in order to set a new password").
- the paying user enters their email inbox Clicks the link that was sent and redirected to my website login page.
- on the login page, the UI presents an empty box for the initial password.
- the user enters the initial password and then the UI lets them choose a permanent password.
- user chooses the permanent password and presses "submit"
- the user is now logged with their permanent password and email.
Now, the user can log with their permanent password and email.