DatabaseUser.logout(dbId, token)
Logs a user out from the database and removes the user session token. This session token will no longer be valid to make any API requests. The method returns no response.
#Parameters The method has the following parameters:
Parameters | Description | Required |
---|---|---|
dbApiKey |
String with database API key. |
Yes. |
token |
String with user token. |
Yes. |
Example
In this example the user signs in and then immediately signs out.
// Script
var dbApiKey = "57928860e4b00ef864f3dc24"
var username = "amy";
var password = "123";
var token = DatabaseUser.login(dbApiKey, username, password).sessionToken;
DatabaseUser.logout(dbApiKey, token);