Skip to content

Commit f8d8c8c

Browse files
committed
fix error when terms and conditions need to be accepted
1 parent 0256287 commit f8d8c8c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

weconnect/auth/we_connect_session.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,17 @@ def doWebAuth(self, authorizationUrl): # noqa: C901
250250
while True:
251251
if 'consent' in afterLoginUrl:
252252
consentURL = afterLoginUrl
253+
if 'terms-and-conditions' in afterLoginUrl:
254+
raise AuthentificationError('It seems like you need to accept the terms and conditions for the Volkswagen service.'
255+
f' Try to visit the URL "https://identity.vwgroup.io/{afterLoginUrl}" or log into the Volkswagen smartphone app')
253256
afterLoginResponse = self.get(afterLoginUrl, allow_redirects=False, access_type=AccessType.NONE)
254257
if afterLoginResponse.status_code == requests.codes['internal_server_error']:
255258
raise RetrievalError('Temporary server error during login')
256259

257260
if 'Location' not in afterLoginResponse.headers:
258261
if consentURL is not None:
259-
raise AuthentificationError('It seems like you need to accept the terms and conditions for the WeConnect ID service.'
260-
f' Try to visit the URL "{consentURL}" or log into the WeConnect ID smartphone app')
262+
raise AuthentificationError('It seems like you need to accept the terms and conditions for the Volkswagen service.'
263+
f' Try to visit the URL "{consentURL}" or log into the Volkswagen smartphone app')
261264
raise APICompatibilityError('No Location for forwarding in response headers')
262265

263266
afterLoginUrl = afterLoginResponse.headers['Location']

0 commit comments

Comments
 (0)