Exemple #1
0
        public async Task <IActionResult> GetLoggedInUser(string userCode)
        {
            HttpContext.VerifyUserHasAnyAcceptedScope(scopeRequiredByApi);

            // TODO: Remove parameter [userCode] before deploying it to production. This is kept for testing purpose so that test by impersonating user
            var employeeCode = userCode ?? HttpContext.User.Identity.Name.Replace("BAIN\\", "");
            var employee     = await _employeeLeavesService.GetEmployeeByEmployeeCode(employeeCode);

            return(Ok(employee));
        }