public IActionResult GetToken(UserModel userModel) { try { if (UserSettings.ValidateUser(_configuration, userModel.User, userModel.Password)) { return(Ok(JwtConfiguration.GenerateJwtToken(_appSettings))); } return(NotFound("Invalid username or password")); } catch (Exception ex) { return(InternalServerErrorResponse(ex)); } }
public IActionResult GetToken(UserModel userModel) { try { if (UserSetting.ValidateUser(_configuration, userModel.User, userModel.Password)) { return(Ok(JwtConfiguration.GenerateJwtToken(_appSetting))); } return(NotFound(new { error = "Invalid username or password", requested = DateTime.UtcNow })); } catch (Exception ex) { return(InternalServerErrorResponse(Resources.Auth, ex)); } }