public async Task <dynamic> GetJWTToken(AuthenticationBodyModel authenticationBody) { var token = GenerateToken(new Authentication { }); return(new { access_token = new JwtSecurityTokenHandler().WriteToken(token), expiration = token.ValidTo }); }
public async Task <IActionResult> GetJWTToken([FromBody] AuthenticationBodyModel model) { var result = await _service.GetJWTToken(model); if (result != null) { return(Ok(result)); } return(StatusCode(StatusCodes.Status204NoContent)); }