Single user per device

Hello everyone,I’m creating application with google login, I’m trying to stop multiple account creation from same device.i have implemented some blocks and checked it work or not.if user already created account using google sign in it don’t let user to create another account.but if user login same I’d from another device,it is adding another device I’d to the database.
I tried many times but I couldn’t.
If anyone help me it would be great.
Here is my block I used.

1 Like

First store the device id on login success.

After that check for the device id.

Instead simply he can use tinydb so store true if the user has login, so when screen intialize get the value if is false then allow to login, if true then don’t allow

What if the user clear data or simply uninstall and reinstall the app?

By storing device id to firebase only one user can login once no matter if he clear data or reinstall the app his device id will be remains in firebase.

2 Likes

I’m storing device I’d in firebase and checking when user login.it is working perfectly but when user login with same gmail from another device I don’t want let them login.

Okay,

On login success, store device id as tag and user email as value in firebase.

Now get all device ids by using “get tag list block”.
After getting tag list for each item in list get value.

By this way you will get a list of all user emails. During this process show a progress dialog with message “Validating account”.

Now check for the email id in the emails list by using “is in list?” block.

If it is not present in the list, then show notification “account validated” and trigger after login event.

If it is present in the list then show choose dialog notification “This email is already registered with another device” set choose buttons to “login again with another account” and “exit”.

When selected “login again” then go back to the login screen. When user login with another email then login will be validated.

I have made this logic according to your requirement, i have not tested this but try it, i think it will work.

you need to use multiple security measurements such as ( UA , IP , IMEI , SN , … etc )

and take them in cloud db and recheck the value.

I tried this way but I couldn’t able to make it work.
But I solved this Own idea.when register store tag device I’d to userID and UserID to Device id.
It will not let user to login multiple accounts.also it will block if user try to login from another device.
Block is below :

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.