Log Out Users

Your website should provide a way for users to log out once they have logged in. Add the following link to your website where you would like a "Logout" prompt to appear:

<a id="Logout">Logout</a> 

After they select the logout option, you should delete any access tokens and refresh tokens associated with that user, and remove their profile information from the website. Your website should then present a login option.

If you are using the Login with Amazon SDK for JavaScript, you can call the amazon.Login.logout method to delete any cached tokens. For example:

Subsequent calls to amazon.Login.authorize will present the login screen by default.

<script type="text/javascript">
  document.getElementById('Logout').onclick function() { 
     amazon.Login.logout();
  };
</script>