View function to log a user out. Supports html and json requests.
776112
def logout(self):
        
        if current_user.is_authenticated:
            self.security_service.logout_user()

        if request.is_json:
            return '', HTTPStatus.NO_CONTENT

        self.flash(_('flask_unchained.bundles.security:flash.logout'),
                   category='success')
        return self.redirect('SECURITY_POST_LOGOUT_REDIRECT_ENDPOINT')
434192
def logout_method(user = current_user)
      http_method = security.logout_method
      http_method || if defined? ::Devise
                       scope = ::Devise::Mapping.find_scope! user
                       mapping = ::Devise.mappings[scope]
                       mapping.sign_out_via
                     end
    end
469114
function logout(){
    console.log('Logout called');
    grout.logout().then(function(){
      console.log('successful logout');
      setStatus();
    }, function (err){
      console.error('logout() : Error logging out:', err);
    });
  }
533093
function logOut(options) {
    var url = getRedirectTo( options, 'root' );
    return function(req, res, next) {
        req.logout();
        res.redirect( url );
    };
}
908143
def logout(request):
    
    # Dispatch the signal before the user is logged out so the receivers have a
    # chance to find out *who* logged out.
    user = getattr(request, 'user', None)
    if hasattr(user, 'is_authenticated') and not user.is_authenticated:
        user = None
    user_logged_out.send(sender=user.__class__, request=request, user=user)

    # remember language choice saved to session
    language = request.session.get(LANGUAGE_SESSION_KEY)

    request.session.flush()

    if language is not None:
        request.session[LANGUAGE_SESSION_KEY] = language

    if hasattr(request, 'user'):
        request.user = MojAnonymousUser()
519011
def js(request):
    """"""
    userid = authenticated_userid(request)
    user = markupsafe.Markup("'%s'")%userid if userid else "null"
    redirect_paramater = request.registry['persona.redirect_url_parameter']
    came_from = '%s%s' % (request.host_url,
                          request.GET.get(redirect_paramater, request.path_qs))
    data = {
        'user': user,
        'login': request.route_path(request.registry['persona.login_route']),
        'logout': request.route_path(request.registry['persona.logout_route']),
        'csrf_token': request.session.get_csrf_token(),
        'came_from': came_from,
        'request_params': markupsafe.Markup(request.registry['persona.request_params']),
    }
    template = markupsafe.Markup(pkg_resources.resource_string('pyramid_persona', 'templates/persona.js').decode())
    return template % data
21611
def logout(self, verbose=False):
        '''
        
        '''
        url = '{}/{}'.format(self.rest_url, 'logout')
        response = self.__auth_req_post(url, verbose=verbose)
        self.headers['X-Opsview-Token'] = None
        return response
506860
function(user) {
      if (Parse.User._currentUser !== user) {
        Parse.User.logOut();
      }
      user._isCurrentUser = true;
      Parse.User._currentUser = user;
      Parse.User._currentUserMatchesDisk = true;

      var json = user.toJSON();
      json._id = user.id;
      json._sessionToken = user._sessionToken;
      Parse.localStorage.setItem(
          Parse._getParsePath(Parse.User._CURRENT_USER_KEY),
          JSON.stringify(json));
    }
1276632
public function handleLogout()
	{
		if (Request::get('logout') !== null) {
			$this->getUserService()->logout();

			//Strip the logout parameter & redirect to the original destination page
			header('Location: ' . __BASE_URL . preg_replace('/(logout&|\?logout$|&logout$)/', '', Request::getRequestPath(__BASE, false)));
			exit;
		}
	}
733110
async def log_out(self):
        
        try:
            await self(functions.auth.LogOutRequest())
        except errors.RPCError:
            return False

        self._bot = None
        self._self_input_peer = None
        self._authorized = False
        self._state_cache.reset()

        await self.disconnect()
        self.session.delete()
        return True
503100
def login_required(view):
    """"""

    @functools.wraps(view)
    def wrapped_view(**kwargs):
        if g.user is None:
            return redirect(url_for("auth.login"))

        return view(**kwargs)

    return wrapped_view
824695
def logout(self):
        
        url = self.address + "/logout"
        header = self.__check_authentication()
        response = requests.get(url, headers=header)
        if response.status_code != 200:
            raise ValueError("Code {}. {}".format(response.status_code, response.json().get("error")))
1259555
def logout(self):
        ''''''
        headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain","User-Agent": user_agent}
        self.session.get('http://'+self.domain+'/logout.phtml',headers=headers)
1259198
public function actionLogout()
    {
        $event = $this->getUserEvent(\Yii::$app->user->identity);

        $this->trigger(self::EVENT_BEFORE_LOGOUT, $event);

        \Yii::$app->getUser()->logout();

        $this->trigger(self::EVENT_AFTER_LOGOUT, $event);

        \Yii::$app->getResponse()->redirect(Url::to([\Yii::$app->getHomeUrl()]));
    }
1054107
public function log_out() {
        if ($accesstoken = $this->get_accesstoken()) {
            $params = array(
                'client_id' => $this->get_clientid(),
                'client_secret' => $this->get_clientsecret(),
                'token' => $accesstoken->token
            );
            $this->reset_state();
            $this->post($this->revoke_url(), $params);
        }
        parent::log_out();
    }
933046
@RequestMapping(value = "/userLogout", method = RequestMethod.GET)
    @ResponseBody
    public JsonObject<?> logout(HttpServletResponse response) {
        JsonObject<?> ret = JsonObject.create();
        CookieUtils.resetCookieValue(response, UserWebConstant.CookieKey.USERNAME.getValue());
        CookieUtils.resetCookieValue(response, UserWebConstant.CookieKey.PWDMD5.getValue());
        return ret;
    }
997709
def logout(self):
        """"""

        if not self.logged_in:
            raise RuntimeError("User is not logged in")
        if self.conn.connected:
            params = {"room": self.conn.room.room_id}
            resp = self.conn.make_api_call("logout", params)
            if not resp.get("success", False):
                raise RuntimeError(
                    f"Logout unsuccessful: "
                    f"{resp['error'].get('message') or resp['error']}"
                )
            self.conn.make_call("logout", params)
            self.conn.cookies.pop("session")
        self.logged_in = False