Could you please use the Network tab in the AppBuilder developer console or a network capture tool like Fiddler to detect the network traffic? The request to http://api.everlive.com/v1/your-api-key/oauth/logout
should have attached the authorization header with the bearer token in it in order to logout successfully the user. If the bearer token is not available, the current user's access_token
is still not available to the Everlive
syntax will access the first globally available instance of the Everlive object, so it is pretty much the same as el.Users.
Could you please check if the permissions of the retrieved content type require authenticated access?
In addition, you can trigger a custom event when the user is authenticated successfully and bind the logout
function to it. Thus you will be sure that the logout()
function will be invoked when the user has been already authenticated - pretty much as the previous example with then()
Here is how to implement this approach:
1. We will use the DOM in order to trigger our custom event:
EventsAggregator = $(document);
When the user authenticates successfully trigger a custom event:
'Unable to connect to network/database - please try again later'
Bind the logout
function to the occurrence of the event:
In order to avoid similar quirks, you may want to move the main logic in the success handler of the login()
Please, let us know if this helps.