Logout¶
The Logout operation terminates user session and disassociates the AuthenticatedUser
role from the subsequent requests made by the client application.
Backendless.UserService.logout()
.then( function() {
})
.catch( function( error ) {
});
Errors¶
The following errors may occur during the Logout API call. See the Error Handling section for details on how to retrieve the error code when the server returns an error.
Error Code |
Description |
---|---|
2002 |
Version is disabled or provided wrong application info (application id or secret key) |
3007 |
Invalid application-id or version. |
3023 |
General error while executing logout. Error details should be available in the message property. |
Example¶
Example¶
// do not forget to call Backendless.initApp( appId, jsAPIKey ) in the app initialization code
function userLoggedOut()
{
console.log( "user has been logged out" );
}
function gotError( err ) // see more on error handling
{
console.log( "error message - " + err.message );
console.log( "error code - " + err.statusCode );
}
function logoutUser()
{
Backendless.UserService.logout()
.then( userLoggedOut )
.catch( gotError ) );
}