public async Task <IActionResult> VerifyPasswordAsync([FromBody] VerifyPasswordDto data) { var result = await _userService.VerifyAsync(data); if (result == null) { return(NotFound()); } return(Ok(result)); }
public async Task <TaskResult <ApplicationUser> > VerifyPassword(VerifyPasswordDto data) { var user = await GetUser(data.Email); var result = await PerformUserAction(user, () => userManager.Authenticate(user, data.Password), false); return(result ? new TaskResult <ApplicationUser>(user) : new TaskResult <ApplicationUser>(new[] { "Incorrect email or password" })); }
public async Task <ResultHandler> VerifyPassword(VerifyPasswordDto data) { var result = await repository.VerifyPassword(data); if (result.Success) { var mappedResult = new TaskResult <AuthenticateDto>(new AuthenticateDto { Token = GenerateJwt(data.Email), UserData = mapper.Map <UserDataDto>(result.Payload) }); return(ResultHandler.HandleTaskResult(mappedResult)); } return(ResultHandler.HandleTaskResult(result)); }
public async Task <bool> ValidatePass([FromBody] VerifyPasswordDto dto) { bool res = await UserService.OldPasswordExists(dto.Id, dto.OldPassword); return(res); }