Exemplo n.º 1
0
        public ActionResult AuthInfo()
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login"));
            }
            FoursquareUserContext fsqDBContext = new FoursquareUserContext();
            FoursquareUserModel   curUser      = fsqDBContext.FoursquareUsers.Find(Convert.ToInt32(User.Identity.Name));

            if (curUser != null)
            {
                UserAuthInfo res = new UserAuthInfo(curUser.FoursquareUserId, curUser.Token);
                return(Json(res, JsonRequestBehavior.AllowGet));
            }
            return(null);
        }
 public ActionResult AuthInfo()
 {
     if (!User.Identity.IsAuthenticated)
     {
         return RedirectToAction("Login");
     }
     FoursquareUserContext fsqDBContext = new FoursquareUserContext();
     FoursquareUserModel curUser = fsqDBContext.FoursquareUsers.Find(Convert.ToInt32(User.Identity.Name));
     if (curUser != null)
     {
         UserAuthInfo res = new UserAuthInfo(curUser.FoursquareUserId, curUser.Token);
         return Json(res, JsonRequestBehavior.AllowGet);
     }
     return null;
 }