title: Firebase sign user up only after successful payment
body: <p>I'm trying to implement the following flow:</p>
  
  <ol>
  <li>User enter website</li>
  <li>User clicks <code>Subscribe now</code></li>
  <li>User gets redirected to <code>Stripe Checkout</code> (because it's easier)</li>
  <li>User successfully pays</li>
  <li>User now can sign in (or even better - is automatically signed in)</li>
  <li>User is charged every month automatically and so is updated database (to control access)</li>
  </ol>
  
  <p>Long story short: give user an access only when he paid.</p>
  
  <p>I'm using Firebase for that, but it seems like there are many roadblocks/headaches:</p>
  
  <ul>
  <li>I can't disable sign up (ideally it should be only via subscription)</li>
  <li><a href="https://firebase.google.com/docs/auth/web/email-link-auth" rel="nofollow noreferrer">Magic Link</a> is not much more helpful because <a href="https://stackoverflow.com/questions/61779992/firebase-email-link-only-for-existing-users-forbid-new-users">you can't change email template sent to the user</a></li>
  <li>in <a href="https://github.com/firebase/functions-samples/blob/master/stripe/functions/index.js" rel="nofollow noreferrer">official example</a> it looks a bit daunting without much of explanation (specially regarding webhooks which are the basis of subscription model)</li>
  </ul>
  
  <p>I looked all around the web about subscription model while using Firebase, but there are almost none.</p>
  
  <p>My question is: anyone implemented subscription service with <strong>Stripe</strong> (any, doesn't have to be Checkout - flow is the same) and <strong>Firebase</strong>? Or should I go for my own server and use Firebase only for database?</p>
  
  <p>I really don't find it as a good UX when user has to first sign up and then pay (too much friction).</p>