I need Firebase Realtime Database Security Rules for this method

Hello!

I make an app for user data manage system.
When any user try to register with my app. User fill the all field and sign up.

I use device tool component to get mobile imei/serial number and mobile number.

To verify the new user already registered with same device/data in firebase realtime database or not.

I use Firebase Authentication V.3.0 by mirxtrem_apps for registration. When user click sign up button the checking process start.

The processing is:

  1. 1st Get Device Imei Number and Mobile Number from your side.

  2. 2nd Check Device Imei Number and Mobile Number in realtime database.

Check Registered-Device Node:
if new data is same as already store data then alert message device already registered.
Else store device imei number and mobile number is Registered-Device Node and other info on Users Node.

node

I need Firebase Realtime Database Security Rules for this method.
I try these Rules. But no data save on firebase database.

{

"rules": {

"users": {

"$uid": {

".read":"auth.uid !== null && $uid === auth.uid",

".write": "auth.uid !== null && $uid === auth.uid"

}

}

}

}

Best Regards
Ali

you cannot read in the databse bc only a auth user can read and write. how do you want to check before the user is auth. This cannot work.

use the firebase auth component from Kodular to login and signup user there you get the info user is signed up if a user wants tosign up again. or you get a error if the email is already taken, and so on

After signup! check device info. if device register already. no data store in database.