Hi Team,
I have a scenario where I want only specific members to get access to my site
I am new to javascript, don’t know much but I think -
-
First, We have to fetch the IP Address.
-
Check it to the database collection (Containing IP Addresses)
-
Then If IP address is found then he will get access.
-
Else will be denied.
Thanks in advance.
There is No Answer In the Post.
This is what I have done -
import { fetch } from 'wix-fetch';
import wixData from 'wix-data';
$w.onReady(function () { });
function checkIP(){
fetch('https://extreme-ip-lookup.com/json', {method: 'get' })
.then((httpResponse) => {
if (httpResponse.ok){
return httpResponse.json();
}
})
.then((json) => {
const ipAddress = json.query;
wixData.query("IPAddress")
.eq("ip", ipAddress)
.find()
.then((results) => {
if(results.items.length === 0){
// Block The Member
}
else{
// Allow The Member
}
})
return ipAddress; // Do we need this??
})
}
Please guide me further.
@yisrael-wix Is there any way of blocking people through code??
Or can we do this-
This is an idea from Russian-Dima old post .
If → YES, then my next question would be…
Am I not able to check the logged -in-state of each user?
If a user is already logged-in and another tries to log-in with the same login-data, but from another IP, am I not able to interrupt this, without the IP or MAC-verification?
Don’t I need just to look onto the log-in-state of this user-id, to find out if the user is already ONLINE?
If so, couldn’t I write some code which can prevent the second log-in?
These are just theoretical thoughts 
This is not a simple matter. Most people are on dynamic IPs which means that you most likely won’t be able to block an individual based on their IP since their IP will likely change each time they come to your site. You might be able to block certain regions or countries based on IPs, but that falls apart if someone is using a VPN.
If as you say, " I want only specific members to get access to my site", why not just have them log in? The login process is simple, secure, and robust.
I have already use the login aspect, but besides I want that one mail work over 1 device only. Actually I have very private site and want security as much as I can.
(Question Changed!!)
IMEI, MEID, ESN or IMSI Can use these aspects. If I can,
How to-
-
Get them
-
Check
-
Block
I found this article Helpful - https://medium.com/@ssaurel/how-to-retrieve-an-unique-id-to-identify-android-devices-6f99fd5369eb
See if you too.
@rinshulgoel The article that you linked to is not using Javascript - I suspect that it’s [Android] Java. That will not work on a Wix site. See the article Corvid: Javascript Support .
@yisrael-wix The article was just for ideas (Things that are constant for devices)
BE VERY SIMPLE, I JUST WANT TO KNOW HOW TO BLOCK PEOPLE FROM USING SITE THROUGH WIX CODE . (So that one can only work on one device at a time)
@rinshulgoel LOGIN - very simple
@yisrael-wix But through login system one can work on multiple devices with same login email id.
Here I want one person can be logged in only at one device at a time.