App_Code.UserVoiceTokenGenerator.CreateWithCurrentUser C# (CSharp) Method

CreateWithCurrentUser() public static method

public static CreateWithCurrentUser ( ) : string
return string
        public static string CreateWithCurrentUser()
        {
            var userDetails = HttpContext.Current.Session["userdetails"] as UserDetails;
            if (HttpContext.Current.User.Identity.IsAuthenticated == false || userDetails == null)
            {
                return string.Empty; //Just return no string if the user isn't found correctly
            }

            return Create(userDetails.Name, userDetails.Email, userDetails.Login);
        }