예제 #1
0
        public IActionResult GetAllInstructors()
        {
            var accessTokenAsString = JwtHelper.GetTokenSubstring(Request.Headers["Authorization"].ToString());

            if (accessTokenAsString == "null")
            {
                return(Unauthorized());
            }
            var userCredentials = JwtHelper.GetCredentialsFromToken(accessTokenAsString);

            return(Ok(_instructorRepository.GetAllInstructorsByDrivingSchoolId(userCredentials.DrivingSchoolId)));
        }