public ActionResult LogOut() { // Init home service var service = new HomeDataService(); //Sharepoint host url string spHostUrl = SessionInfo.Current.SPContext.SPHostUrl.ToString(); //clear the SP Context SessionInfo.Current.SPContext = null; // Logout the current token service.LogOut(SessionInfo.Current.AccessToken); // Clear the session Session.Abandon(); return Redirect(spHostUrl); }
public ActionResult LogOut() { // Init home service var service = new HomeDataService(); // Logout the current token service.LogOut(SessionInfo.Current.AccessToken); // Clear the session Session.Abandon(); // Redirect back to landing page return RedirectToAction("Index", "Home"); }