public IActionResult AllowResetPassword(string code) { var _user = userRep.GetUserByToken(code); if (_user == null) { return(BadRequest()); } serviceUser.SetTemporaryToken(_user.Token); return(View()); }
public async Task <IActionResult> ConfirmEmail(string token) { var _user = userRep.GetUserByToken(token); if (_user == null) { return(BadRequest()); } _user.Token = null; _user.ConfirmEmail = true; await userRep.UpdateUserAsync(_user); return(RedirectToAction("Index", "Login")); }