public IActionResult SignIn(UserCondition condition) { var model = _userService.LoginUser( new Entities.User { UserId = condition.UserId, UserPassword = condition.UserPassword }); if (model == null) { throw new Exception("No data"); } var token = _tokenManager.Create(model); model.UserToken = token.RefreshToken; var result = _userService.Update(model); if (result.Success == false) { throw new Exception("Please contact MIS"); } return(Ok(token)); }
public async Task <ActionResult <string> > Token() { await Task.CompletedTask; var token = tokenManager.Create(User); foreach (var cookie in Request.Cookies) { Response.Cookies.Delete(cookie.Key); } return(Ok(token)); }
public async Task <IActionResult> CreateAuth(AuthUserModel authUserModel) { var authUserDto = _mapper.Map <AuthUser>(authUserModel); await _tokenManager.Create(authUserDto); return(Ok()); }