Beispiel #1
0
        public ActionResult LogOff(string returnUrl)
        {
            _authenticationService.SignOut();

            var loggedUser = _authenticationService.GetAuthenticatedUser();

            if (loggedUser != null)
            {
                _userEventHandler.LoggedOut(loggedUser);
            }

            return(this.RedirectLocal(returnUrl));
        }
Beispiel #2
0
        public void SignOut()
        {
            _authenticationService.SignOut();

            var loggedUser = _authenticationService.GetAuthenticatedUser();

            if (loggedUser != null)
            {
                _userEventHandler.LoggedOut(loggedUser);
            }
        }
Beispiel #3
0
        public HttpResponseMessage LogOut(string Hash = null)
        {
            var wasLoggedInUser = _authenticationService.GetAuthenticatedUser();

            _authenticationService.SignOut();
            _orchardServices.WorkContext.HttpContext.Session.Remove("doticca_aid");
            if (wasLoggedInUser != null)
            {
                if (Hash != null)
                {
                    _loginsService.DeleteHash(Hash);
                }
                _userEventHandler.LoggedOut(wasLoggedInUser);
            }


            return(Request.CreateResponse(HttpStatusCode.OK, "User succesfully logged out"));
        }
        public RedirectResult LogOff(string openIdProvider)
        {
            if (String.IsNullOrWhiteSpace(openIdProvider))
            {
                openIdProvider = OpenIdConnectAuthenticationDefaults.AuthenticationType;
            }

            HttpContext.GetOwinContext().Authentication.SignOut(openIdProvider, CookieAuthenticationDefaults.AuthenticationType);
            _authenticationService.SignOut();

            var loggedUser = _authenticationService.GetAuthenticatedUser();

            if (loggedUser != null)
            {
                _userEventHandler.LoggedOut(loggedUser);
            }

            return(Redirect(Url.Content("~/")));
        }