Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> LogOutAsync(
            [FromBody] LogOutModel model,
            CancellationToken cancellationToken
            )
        {
            await _mediator.Send(new LogOut(model), cancellationToken);

            return(NoContent());
        }
Ejemplo n.º 4
0
 public LogOut(LogOutModel model)
 {
     Model = model ?? throw new ArgumentNullException(nameof(model));
 }
Ejemplo n.º 5
0
 public IActionResult LogOut()
 {
     return(Redirect(LogOutModel.SignOut(Request.HttpContext)));
 }