Firebase - Prevent user authentication -


i need prevent user authentication if email isn't found in allowedusers. doesn't affect app, since actions performed on users list, nice if authentication doesn't happen.

loginwithgoogle() {     const userdetails = this.afauth.auth.signinwithpopup(new firebase.auth.googleauthprovider())       .then(user => {         console.log(user.user.uid);          const queryobservable = this.db.list('/allowedusers', {           query: {             orderbychild: 'email',             equalto: user.user.email,           }         }).subscribe(data => {            if (data.length > 0) {              const userobj = {               admin: false,               ...               email: data[0].email,               name: data[0].name,               verified: false,             };              this.adduser(userobj, user.user.uid);            }          });        });      return userdetails;   } 

there no way prevent user authenticating firebase authentication. when authenticate "i x yz" , prove it.

what can prevent have access database. example allow white-listed users read-access database:

{   "rules": {     ".read": "root.child('allowedusers').child(auth.uid).exists()"   } } 

also see:


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -