mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 21:39:22 +00:00
Get current user ID
This commit is contained in:
parent
c304c2f88e
commit
6119d5d0ff
@ -41,4 +41,14 @@ export class AccountController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get current user ID
|
||||||
|
*
|
||||||
|
* @param handler
|
||||||
|
*/
|
||||||
|
public static CurrentUserID(handler: RequestHandler) {
|
||||||
|
handler.send({
|
||||||
|
userID: handler.getUserId()
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
@ -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
|
||||||
]
|
]
|
Loading…
Reference in New Issue
Block a user