I've a project in which I used to authenticate the users with firebase-auth
.In my project users can not create their accounts on their own.Only admin have the privilege to add the user accounts.
In order to use onAuthStateChanged()
function I must use firebase-auth
in my page.But the issue is because of using firebase-auth
on client side one can esaily create accounts by running createUserWithEmailAndPassword()
function on the console without having the admin privilege.
Now how can I restrict the people from using createUserWithEmailAndPassword()
function on client side?
The only way you can stop clients apps from creating accounts is to disable all authentication providers for your project in the Firebase console. You could write an auth onCreate Cloud Function that attempts to figure out if a new account was created by client or admin code if you want to try to delete it immediately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With