private void Login(WebSocketSession session) { if (this._manager_login_c > 0) { //登出 LogOutModel model = new LogOutModel() { Msg = AJaxMsgCommand.S_MANAGER_LOGOUT }; this.SendMessage(JsonConvert.SerializeObject(model)); this.PutLogQueue("Web LogOut!", ConsoleColor.Yellow); } //标识通过验证 this._manager_session = session; session.Items.Add(1, 1); Interlocked.Increment(ref _manager_login_c); //重新连接 if (this._logOut) { this._sessionProvider.StartSerivce(); this._logOut = false; } GetClientLoginInfo(); }
public async Task <IActionResult> Logout(LogOutModel model) { // build a model so the logged out page knows what to display var vm = await BuildLoggedOutViewModelAsync(model.LogoutId); if (User?.Identity.IsAuthenticated == true) { // delete local auth cookie await HttpContext.SignOutAsync(); // raise logout event await _events.RaiseAsync(new UserLogoutSuccessEvent(User.GetSubjectId(), User.GetDisplayName())); } // check if we need to trigger sign-out at an upstream identity provider if (vm.TriggerExternalSignout) { string url = Url.Action("Logout", new { logoutId = vm.LogoutId }); return(SignOut(new AuthenticationProperties { RedirectUri = url }, vm.ExternalAuthenticationScheme)); } return(View("LoggedOut", vm)); }
public async Task <ActionResult> LogOutAsync( [FromBody] LogOutModel model, CancellationToken cancellationToken ) { await _mediator.Send(new LogOut(model), cancellationToken); return(NoContent()); }
public LogOut(LogOutModel model) { Model = model ?? throw new ArgumentNullException(nameof(model)); }
public IActionResult LogOut() { return(Redirect(LogOutModel.SignOut(Request.HttpContext))); }