Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webauth): handle InvalidPassword error in _startSessionWithCredentials #6

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions steam/webauth.py
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@
from getpass import getpass
import requests

from steam.enums.common import EResult
from steam.enums.proto import EAuthSessionGuardType, EAuthTokenPlatformType, ESessionPersistence
from steam.steamid import SteamID
from steam.utils.web import generate_session_id
@@ -208,10 +209,16 @@ def _startSessionWithCredentials(self, account_encrypted_password: str,
'BeginAuthSessionViaCredentials',
1
)
self.client_id = resp['response']['client_id']
self.request_id = resp['response']['request_id']
self.steam_id = SteamID(resp['response']['steamid'])
self.allowed_confirmations = [EAuthSessionGuardType(confirm_type['confirmation_type']) for confirm_type in resp['response']['allowed_confirmations']]
try:
self.client_id = resp['response']['client_id']
self.request_id = resp['response']['request_id']
self.steam_id = SteamID(resp['response']['steamid'])
self.allowed_confirmations = [EAuthSessionGuardType(confirm_type['confirmation_type']) for confirm_type in resp['response']['allowed_confirmations']]
except KeyError as e:
if resp.get('response', {}).get('interval') == EResult.InvalidPassword:
raise LoginIncorrect(resp)
else:
raise WebAuthException(e, resp)

def _startLoginSession(self):
"""Starts login session via credentials."""
Loading