Just wanted to thank you for sharing your code! Worked great!
Some related things in case anyone else walks down this road:
-
be sure to add your domain to Authorized domains in Firebase Console (Authentication → Sign-in Method)
-
pay careful attention to this comment in the code above, during testing it might catch you off guard
// In this case, we are enforcing that the user signed in in the last 5 minutes. -
if you need to use CORS to access from a different domain you can use multiple middlewares by passing in an array: [cors(corsOptions),formidable()]
Thanks again for sharing!