Exemple #1
0
        public IActionResult AllowResetPassword(string code)
        {
            var _user = userRep.GetUserByToken(code);

            if (_user == null)
            {
                return(BadRequest());
            }

            serviceUser.SetTemporaryToken(_user.Token);
            return(View());
        }
Exemple #2
0
        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"));
        }