Deauthenticate the user.

Logout the user and remove any cache associated to the user.

Authorization: Bearer xxx

@Delete(uri="/")
@Request(contentType="application/json")
@Transaction({
@Response(200),
})
762885
public function deauthenticate(ResponseFactory $response, Guard $guard, JWTAuth $auth)
    {
        $guard->logout();
        $auth->invalidate();

        return $response->json([]);
    }
1031601
def delete
      user = Cadenero::User.find_by_id(params[:id])
      if user_signed_in?
        env['warden'].logout(:user)
        render json: {message: "Successful logout"}, status: :ok
      else
        render json: {message: "Unsuccessful logout user with id"}, status: :forbidden
      end
    end
1195482
public void logout(Context context, ResponseListener listener){
        clearAuthorizationData();
        authorizationProcessManager.logout(context, listener);
    }
622052
public function clearCache($user = true, $opcode = true, $authentication = null)
    {
        $filename = $this->createTemporaryFile($user, $opcode);
        $url = sprintf('%s/%s', $this->host, basename($filename));

        try {
            $result = $this->sendRequest($url, $authentication);
        } catch (\Exception $e) {
            unlink($filename);

            throw $e;
        }

        unlink($filename);

        return json_decode($result, true);
    }
991440
def logout(self):
        
        self.client.global_sign_out(
            AccessToken=self.access_token
        )

        self.id_token = None
        self.refresh_token = None
        self.access_token = None
        self.token_type = None
16784
def clear_authentication(self):
        
        self._authentication = None
        self.access_token = None
        self.refresh_token = None
        self.http.cookies.clear()
        self.user = None
93974
def revoke_access_token(self, access_token):
        
        payload = {'access_token': access_token,}
        req = requests.post(settings.API_DEAUTHORIZATION_URL, data=payload)
825292
public function logout(Request $request): JsonResponse
    {
        /** @var HCUser $user */
        $user = $request->user();
        $user->updateLastActivity();
        $user->token()->revoke();

        return $this->response->success(trans('HCCore::users.message.logged_out'));
    }
442584
def destroy(self, request, pk=None):
        ''''''
        user = self.get_object()
        user.is_active = False
        user.save()
        return Response(status=status.HTTP_204_NO_CONTENT)
707605
def logout(request):
    '''
    
    '''
    user = request.user
    serializer = LogoutSerializer(data=request.data)
    serializer.is_valid(raise_exception=True)
    data = serializer.validated_data

    if should_authenticate_session():
        auth.logout(request)
    if should_retrieve_token() and data['revoke_token']:
        try:
            user.auth_token.delete()
        except Token.DoesNotExist:
            raise BadRequest('Cannot remove non-existent token')

    return get_ok_response('Logout successful')
1027417
def logout(cache):
    
    cache.set(flask.session['auth0_key'], None)
    flask.session.clear()
    return True
1168287
protected void deactivate(ComponentContext context) {
        final boolean trace = TraceComponent.isAnyTracingEnabled();

        // Block the progress of deactivate so that session manager is able to access the cache until it finishes stopping applications.
        // The approach of blocking is copied from DatabaseStoreService as a temporary workaround. It would be nice to have a better solution here.
        final long MAX_WAIT = TimeUnit.SECONDS.toNanos(10);
        for (long start = System.nanoTime(); !completedPassivation && System.nanoTime() - start < MAX_WAIT; )
            try {
                TimeUnit.MILLISECONDS.sleep(100); // sleep 1/10th of a second
            } catch (InterruptedException e) {
            }

        if (cachingProvider != null) {
            if (trace && tc.isDebugEnabled())
                CacheHashMap.tcInvoke(tcCachingProvider, "close");

            AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
                cachingProvider.close();
                return null;
            });

            if (trace && tc.isDebugEnabled())
                CacheHashMap.tcReturn(tcCachingProvider, "close");

            cachingProvider = null;
            cacheManager = null;
        }
    }
310415
def logout(self):
        
        self.req(API_ACCOUNT_LOGOUT % self.ck())
        self.cookies = {}
        self.user_alias = None
        self.persist()
528945
def _do_logoff(self):
        
        session_uri = '/api/sessions/this-session'
        self.delete(session_uri, logon_required=False)
        self._session_id = None
        self._session = None
        self._headers.pop('X-API-Session', None)
444139
public function logout()
    {

        // load the user identity and the subject's principals
        $identity = $this->getIdentity();
        $principals = $this->subject->getPrincipals();

        // remove the user identity from the subject
        foreach ($principals as $key => $principal) {
            if ($identity->equals($principal)) {
                $principals->remove($key);
            }
        }

        // return TRUE on success
        return true;
    }
1002702
public function logout()
    {
        $user = $this->user();

        // If we have an event dispatcher instance, we can fire off the logout event
        // so any further processing can be done. This allows the developer to be
        // listening for anytime a user signs out of this application manually.
        $this->clearUserDataFromStorage();

        if (! is_null($this->user) && ! empty($user->getRememberToken())) {
            $this->cycleRememberToken($user);
        }

        if (isset($this->events)) {
            $this->events->dispatch(new Events\Logout($this->name, $user));
        }

        // Once we have fired the logout event we will clear the users out of memory
        // so they are no longer available as the user is no longer considered as
        // being signed into this application and should not be available here.
        $this->user = null;

        $this->loggedOut = true;
    }
1248714
public function deactivate()
    {
        if ($this->check()) {
            return $this->matrix()->request('POST', $this->endpoint('account/deactivate'), [
                'auth' => [
                    'type' => 'm.login.password'
                ]
            ], [
                'access_token' => $this->data['access_token']
            ]);
        }
        throw new \Exception('Not authenticated');
    }