public ActionResult LogOff(string returnUrl) { _authenticationService.SignOut(); var loggedUser = _authenticationService.GetAuthenticatedUser(); if (loggedUser != null) { _userEventHandler.LoggedOut(loggedUser); } return(this.RedirectLocal(returnUrl)); }
public void SignOut() { _authenticationService.SignOut(); var loggedUser = _authenticationService.GetAuthenticatedUser(); if (loggedUser != null) { _userEventHandler.LoggedOut(loggedUser); } }
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("~/"))); }