public IActionResult RefreshToken([FromHeader] string Authorization) { var baseUser = _authUser.CheckRefreshToken(Authorization); if (baseUser != null && baseUser.IsActive) { var tokens = _jwtTokenProvider.GenerateJwtUserToken(baseUser); var payloadData = _authUser.PackPayloadPart(tokens, baseUser); return(Ok(new JsonPayloadPattern().JsonPayload(_success, "", Ok().StatusCode, payloadData))); } return(Unauthorized()); }
public IActionResult Post([FromBody] UserDTO userDTO) { var baseUser = this._authUser.CheckUser(userDTO); if (baseUser != null && baseUser.IsActive) { if (this._authUser.Authenticate(baseUser, userDTO)) { var tokens = _jwtTokenProvider.GenerateJwtUserToken(baseUser); var payloadData = _authUser.PackPayloadPart(tokens, baseUser); return(Ok( new JsonPayloadPattern().JsonPayload(_success, "", Ok().StatusCode, payloadData))); } } return(Unauthorized()); }