public bool ResetPassword(ResetPassParams passParams) { var command = new DatabaseCommand <ResetPassParams, bool>() { CallingInfo = passParams }; this.ProxyCalling(ResetPasswordProxy, command); return(command.ReturnValue); }
public async Task <IActionResult> ResetPassword(ResetPassParams passes) { if (!_tokenizer.ValidateToken(passes.Token)) { return(BadRequest()); } var username = _tokenizer.DecodeToken(passes.Token).ToDictionary(x => x.Key, x => x.Value)[ClaimTypes.Email]; GlobalHelpers.CurrentUser = await _dbService.FindByUsernameAsync(username); if (await _dbService.TryChangePasswordAsync(passes.NewPassword)) { return(Ok()); } return(BadRequest()); }