Clean up some stuff

This commit is contained in:
Schuyler Cebulskie
2016-09-19 04:32:24 -04:00
parent 6ede7a32fd
commit 6a94658dd7
7 changed files with 83 additions and 57 deletions

View File

@@ -13,9 +13,15 @@ class RESTMethods {
this.rest = restManager;
}
loginToken(token) {
return new Promise((resolve, reject) => {
this.rest.client.manager.connectToWebSocket(token, resolve, reject);
});
}
loginEmailPassword(email, password) {
return new Promise((resolve, reject) => {
this.rest.client.emit('debug', 'Client launched using email and password - should use token instead');
this.rest.client.emit('warn', 'Client launched using email and password - should use token instead');
this.rest.client.email = email;
this.rest.client.password = password;
this.rest.makeRequest('post', Constants.Endpoints.login, false, { email, password })
@@ -26,12 +32,6 @@ class RESTMethods {
});
}
loginToken(token) {
return new Promise((resolve, reject) => {
this.rest.client.manager.connectToWebSocket(token, resolve, reject);
});
}
logout() {
return this.rest.makeRequest('post', Constants.Endpoints.logout, true);
}