Пример #1
0
        public Task <string> LoginAsync(AuthRequest request)
        {
            var user = userSecurityRepository.GetByEmail(request.Email);

            user.CreateToken(abiokaToken, Guid.NewGuid().ToString());
            userSecurityRepository.Update(user);
            return(Task.FromResult(user.Token));
        }
Пример #2
0
        public string ChangePassword(ChangePasswordRequest request)
        {
            var user = userSecurityRepository.FindById(currentContext.Current.Principal.Id);

            user.ChangePassword(request.OldPassword, request.NewPassword);
            user.CreateToken(abiokaToken, Guid.NewGuid().ToString());
            userSecurityRepository.Update(user);

            return(user.Token);
        }