accounts: anthentifyView: add: enter button

This commit is contained in:
2024-02-13 12:53:38 +01:00
committed by AdrienLSH
parent cf9bd41dd0
commit d21ec87b88
2 changed files with 34 additions and 26 deletions

View File

@ -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
}