diff --git a/src/controllers/AccountController.ts b/src/controllers/AccountController.ts index 6b3e808..15ec87c 100644 --- a/src/controllers/AccountController.ts +++ b/src/controllers/AccountController.ts @@ -41,4 +41,14 @@ export class AccountController { }); } + /** + * Get current user ID + * + * @param handler + */ + public static CurrentUserID(handler: RequestHandler) { + handler.send({ + userID: handler.getUserId() + }); + } } \ No newline at end of file diff --git a/src/controllers/Routes.ts b/src/controllers/Routes.ts index 552c5ff..03a835c 100644 --- a/src/controllers/Routes.ts +++ b/src/controllers/Routes.ts @@ -28,4 +28,7 @@ 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/id", cb: AccountController.CurrentUserID}, + {path: "/user/getCurrentUserID", cb: AccountController.CurrentUserID}, // Legacy ] \ No newline at end of file