Verify logged in user with chrome extensions

0

I have an extension for google chrome but I want it to verify if the user is logged in correctly on the main page.

How can I perform this verification from the extension?

A clear example is the trello extension, verify that your account is logged in.

Link to install the trello extension

    
asked by Jhosselin Giménez 14.03.2017 в 22:50
source

1 answer

0

Try to use data in the cache to verify that the user is already inside or already logged in.

you can use the local storage There is already a JS who does all the work.

link

With this you can keep data in your browser as long as the navigation history cache is not cleaned

implementation      // set Cookie     amplify.storage ("myvar", '{"id": "1234", "name": "jose", "session": true}');

//get Cookie
 amplify.storage("myvar");

and you can make a validation to see if it is logged in

if (amplify.storage ("myvar")! = undefined) {

enter_main ();

} else {

ir_loggin ();

}

    
answered by 14.03.2017 в 23:20