1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-21 00:55:17 +00:00

Can sign out user

This commit is contained in:
2019-11-23 14:03:14 +01:00
parent 6119d5d0ff
commit e635802296
4 changed files with 63 additions and 3 deletions

View File

@ -41,6 +41,19 @@ export class AccountController {
});
}
/**
* Disconnect user
*
* @param handler
*/
public static async LogoutUser(handler: RequestHandler) {
await AccountHelper.DestroyUserTokens(handler.getClientInfo(),
handler.getUserId());
handler.success("User has been disconnected!");
}
/**
* Get current user ID
*

View File

@ -28,6 +28,9 @@ export const Routes : Route[] = [
// Account controller
{path: "/account/login", cb: AccountController.LoginUser, needLogin: false},
{path: "/user/connectUSER", cb: AccountController.LoginUser, needLogin: false}, // Legacy
{path: "/account/logout", cb: AccountController.LogoutUser},
{path: "/user/disconnectUSER", cb: AccountController.LogoutUser}, // Legacy
{path: "/account/id", cb: AccountController.CurrentUserID},
{path: "/user/getCurrentUserID", cb: AccountController.CurrentUserID}, // Legacy