public async Task <IActionResult> Login([FromBody] LoginViewModel loginViewModel) { if (!ModelState.IsValid) { return(BadRequest()); } var user = await _userServices.GetUser(loginViewModel); if (user != null) { string result = $"Beaner {jwtHelper.CreateJwt(user.UserName)}"; return(Ok(result)); } return(NotFound()); }
public string CreateJwt(IWebSession session) { return(JwtHelper.CreateJwt(session, _jwtSecret, 1)); }