Skip to content

Commit 3271bcc

Browse files
author
hrkut
committed
Added userStatus method
1 parent 756da3d commit 3271bcc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

public/js/chat/AuthAPI.js

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ class AuthAPI extends DataService {
99
super("authApi");
1010
}
1111

12+
/**
13+
* Check and return current status of the user
14+
* @returns {Promise<object|null>} Object with the login attribute, if there is no error
15+
*/
16+
async userStatus() {
17+
let response = await this.sendRequest(
18+
"status",
19+
"POST",
20+
200,
21+
{},
22+
null);
23+
return response != null ? response.login : response;
24+
}
25+
1226
/**
1327
* Check and return current status of the user
1428
* @returns {Promise<object|null>} Object with attribute login, if there is no error

0 commit comments

Comments
 (0)