BusinessLogic.Logic.Users.AuthTokenValidator.ValidateAuthToken C# (CSharp) Method

ValidateAuthToken() public method

public ValidateAuthToken ( string authToken ) : ApplicationUser
authToken string
return ApplicationUser
        public ApplicationUser ValidateAuthToken(string authToken)
        {
            string hashedAndSaltedAuthToken = authTokenGenerator.HashAuthToken(authToken);
            return dataContext.GetQueryable<ApplicationUser>()
                .FirstOrDefault(x => x.UserDeviceAuthTokens.Any(y => y.AuthenticationToken == hashedAndSaltedAuthToken && DateTime.UtcNow <= y.AuthenticationTokenExpirationDate));
        }
    }