I am trying to logout the user from my application and I have a button listening for a click event to perform the logout algorithm which looks something like the below code how