I am building an chrome extension in which I used
chrome.identity.getAuthToken({
interactive: true
}, function(token) {
if (chrome.runtime.lastError) {
alert(chrome.runtime.lastError.message);
return;
}
var x = new XMLHttpRequest();
x.open('GET', 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=' + token);
x.onload = function() {
alert(x.response);
};
x.send();
});
on background.js for google login authentication.
When this function called, a window appear which show logged-in google accounts (if any) but my problem is it shows only 1 account but I logged-in 5 accounts in the browser.
Is there anything which I missed over here ?
And I also need to know how to write logout function ?