How to make sure the email is logged in only once?


I created a small chrome extension for a specific scope of users.
How can I make sure that a user is logged in only on one machine to avoid sharing the Extension without users paying for it?

Is there any way to do so?

With other apps I check the UUID and compare it against my list of users.

I struggle to understand the identify API tbh.

This is my way currently but it only tracks if the user is in my list.

Edit:

(function () {
    chrome.identity.getProfileUserInfo({ 'accountStatus': 'ANY' }, async function (info) {
        email = info.email;
        console.log(info.id);

        let response = await fetch('https://pastebin.com/');
        let data = await response.text();

        console.log(data.indexOf(info.id));

        if (info.id === '') {
            chrome.browserAction.setPopup({ popup: 'index.html' });
            alert(info.id);
        } else if (data.indexOf(info.id) !== -1) {
            console.log('License is valid');
        } else {
            chrome.browserAction.setPopup({ popup: 'index.html' });
            alert(info.id);

            // block chrome extension usage;
        }
    });
})();

Source: JavaSript – Stack Overflow

October 30, 2021
Category : News
Tags: google-chrome-extension | google-oauth | javascript | oauth | oauth-2.0

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.