Esempio n. 1
0
        public string UserInfoMethod(string accessToken)
        {
            foreach (var el in availableUsers)
            {
                if (el.Token == accessToken)
                {
                    if (el.ExpDate > DateTime.Now)
                    {
                        UserInfoC info = new UserInfoC();
                        info.Name     = el.UName;
                        info.LastName = el.ULastName;

                        return(JsonConvert.SerializeObject(info));
                    }
                    else
                    {
                        string error = "error:Token Data was expiried";
                        return(JsonConvert.SerializeObject(error));
                    }
                }
            }

            string error2 = "error:Not correct access token";

            return(JsonConvert.SerializeObject(error2));
        }
Esempio n. 2
0
        public string UserInfoMethod(string accessToken)
        {
            foreach (var el in availableUsers)
            {
                if (el.Token == accessToken && el.ExpDate > DateTime.Now)
                {
                    UserInfoC info = new UserInfoC();
                    info.Name     = el.UName;
                    info.LastName = el.ULastName;

                    return(JsonConvert.SerializeObject(info));
                }
            }

            return(null);
        }
Esempio n. 3
0
        public string UserInfoMethod(string accessToken)
        {
            foreach (var el in availableUsers)
            {
                if (el.Token == accessToken)
                {
                    if (el.ExpDate > DateTime.Now)
                    {
                        UserInfoC info = new UserInfoC();
                        info.Name = el.UName;
                        info.LastName = el.ULastName;

                        return JsonConvert.SerializeObject(info);
                    }
                    else
                    {
                        string error = "error:Token Data was expiried";
                        return JsonConvert.SerializeObject(error);
                    }
                }
            }

            string error2 = "error:Not correct access token";
            return JsonConvert.SerializeObject(error2);
        }
Esempio n. 4
0
        public string UserInfoMethod(string accessToken)
        {
            foreach (var el in availableUsers)
            {
                if (el.Token == accessToken && el.ExpDate > DateTime.Now)
                {
                    UserInfoC info = new UserInfoC();
                    info.Name = el.UName;
                    info.LastName = el.ULastName;

                    return JsonConvert.SerializeObject(info);
                }
            }

            return null;
        }