示例#1
0
        public async Task <IHttpActionResult> CurrentUser()
        {
            try
            {
                User _user = await _userFactory.Build(await _unitOfWork.UserStore.FindByNameAsync(User.Identity.Name));

                return(Ok(_user));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
示例#2
0
        public async Task <IHttpActionResult> ConfirmToken([FromBody] string token)
        {
            PasswordResetToken _token = await UnitOfWork.PasswordResetTokenStore.FindByToken(token);

            if (_token == null)
            {
                return(BadRequest("Invalid Token"));
            }
            if (_token.Expires < DateTime.Now)
            {
                return(BadRequest("Expired Token"));
            }
            if (_token.Used.HasValue)
            {
                return(BadRequest("Token Already Used"));
            }
            ISS.Authentication.Public.Domain.ViewModels.User _user = await UserFactory.Build(_token.UserId);

            if (_user == null)
            {
                return(BadRequest("User not Found"));
            }
            return(Ok(_user));
        }
示例#3
0
 public IUser LoadUser(string userName, string password, string userType)
 {
     return(UserFactory.Build(userName, password, userType));;
 }