1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-26 07:19:23 +00:00

Get current user ID

This commit is contained in:
Pierre HUBERT 2019-11-23 13:48:16 +01:00
parent c304c2f88e
commit 6119d5d0ff
2 changed files with 13 additions and 0 deletions

View File

@ -41,4 +41,14 @@ export class AccountController {
}); });
} }
/**
* Get current user ID
*
* @param handler
*/
public static CurrentUserID(handler: RequestHandler) {
handler.send({
userID: handler.getUserId()
});
}
} }

View File

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