Logout In Electron


#1

hi,

I want to add logout in my application.
following is my code
function logout() {
var r = confirm(“Do you really want to log out?”);
if ® {
window.location.assign(’ index.html’);
}
}
it is ok for now. but i want to add a little more.
i want to close all the child window opened at the same time.
if anyone knows please help


#2

Whenever you open a child window, you create an object. If those objects are assigned to variables that the user session can see, then it’s easy to look them up and send close commands on logout.


#3

thanks for the tip, can you please give an example or something to make things clear…


#4

The Electron documentation covers child window behavior and shows you how to assign and interact with an object that represents a window.


#5

ok thanks bro


#6

what if i am creating a window from another file not main js , then how do i make it to the child of main window and is it possible to close all other window when logged out?