Beispiel #1
0
        public async Task <IActionResult> SignIn(LoginModel loginModel)
        {
            var student = await _userRepository.SignInAsync(loginModel);

            if (student == null)
            {
                return(NotFound(new { error = "Invalid ssn or password" }));
            }
            var token = _jwtManager.Auth(student.Id, student.Role);

            return(Ok(token));
        }