accounts: anthentifyView: add: enter button
This commit is contained in:
@ -16,18 +16,15 @@ class Account
|
||||
/**
|
||||
* @param {String} username
|
||||
* @param {String} password
|
||||
* @returns {?Promise<Object>}
|
||||
* @returns {Response}
|
||||
*/
|
||||
async create(username, password)
|
||||
{
|
||||
let response = await this.client._post("/api/accounts/register", {username: username, password: password});
|
||||
let response_data = await response.json()
|
||||
|
||||
if (response_data == "user created")
|
||||
{
|
||||
if (response.status === 201)
|
||||
await this.client._update_logged(true);
|
||||
return null;
|
||||
}
|
||||
|
||||
return response_data
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user