LogOut() public method

this function is used to logout the user
public LogOut ( string accessToken ) : string
accessToken string
return string
Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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");
        }