steampy icon indicating copy to clipboard operation
steampy copied to clipboard

Logout unsuccessful

Open Slava-stack opened this issue 1 year ago • 1 comments

after creating a buy order with this code

with SteamClient(api_key, username, password, steam_guard_path) as client:
    response = client.market.create_buy_order("AK-47 | Redline (Field-Tested)", "1000", 1, game, currency)
    buy_order_id = response
    print(buy_order_id)

I receive type of error:

...\env\lib\site-packages\steampy\client.py", line 120, in logout, line 120, in logout
    raise Exception('Logout unsuccessful')
Exception: Logout unsuccessful

everything works good enough but i am currious if I can make this error to be fixed? My logout function looks excactly like that:

@login_required
def logout(self) -> None:
    url = f'{SteamUrl.STORE_URL}/login/logout/'
    data = {'sessionid': self._get_session_id()}
    self._session.post(url, data=data)
    if self.is_session_alive():
        raise Exception('Logout unsuccessful')

    self.was_login_executed = False

Slava-stack avatar Jan 29 '24 10:01 Slava-stack

Change url = f'{SteamUrl.STORE_URL}/login/logout/' to url = f'{SteamUrl.COMMUNITY_URL}/login/logout/'

Lexzach avatar Feb 23 '24 00:02 Lexzach

thx a lot

slavasova6 avatar Apr 11 '24 03:04 slavasova6