Exemplo n.º 1
0
        public IHttpActionResult LogoutFB()
        {
            string           token      = HttpContext.Current.Request.Params["code"];
            FacebookProvider fbProvider = new FacebookProvider();

            Uri url = fbProvider.GetLogoutUrl(token);

            return(Ok(url));
        }
Exemplo n.º 2
0
        public IHttpActionResult Logout()
        {
            string token = ActionContext.Request.Headers.Authorization.ToString();

            token tokenFromDB = _db.token.Where(x => x.tokenValue == token).First();

            if (tokenFromDB.type == 1)
            {
                FacebookProvider fbProvider = new FacebookProvider();

                Uri url = fbProvider.GetLogoutUrl(tokenFromDB.tokenValue);
            }

            tokenFromDB.active = false;

            _db.token.Attach(tokenFromDB);
            _db.Entry(tokenFromDB).State = EntityState.Modified;
            _db.SaveChanges();

            return(Ok());
        }