Skip to content

Commit 9ebea13

Browse files
committed
Correctly Handle "Legacy authorization refused." Login Error
1 parent 24d9fc4 commit 9ebea13

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Aydsko.iRacingData/DataClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ private async Task LoginInternalAsync(CancellationToken cancellationToken)
20072007
if (loginResult is null || !loginResult.Success)
20082008
{
20092009
var message = loginResult?.Message ?? $"Login failed with HTTP response \"{loginResponse.StatusCode} {loginResponse.ReasonPhrase}\"";
2010-
throw iRacingLoginFailedException.Create(message, loginResult?.VerificationRequired);
2010+
throw iRacingLoginFailedException.Create(message, loginResult?.VerificationRequired, string.Equals(loginResult?.Message, "Legacy authorization refused.", StringComparison.OrdinalIgnoreCase));
20112011
}
20122012

20132013
IsLoggedIn = true;
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
BREAKING CHANGES:
2+
3+
iRacing has enabled two-factor authentication by default. To continue to use this library you **must** [enable "Legacy Authentication" in your iRacing account settings](https://support.iracing.com/support/solutions/articles/31000173894-enabling-or-disabling-legacy-read-only-authentication) before attempting to authenticate. Please **do not** enable this setting unless you require it, as it may reduce the security on your iRacing account.
4+
15
Fixes / Changes:
26

3-
- DriverResult is missing the CountryCode property (Issue #228)
4-
Included the "CountryCode" property in the "DriverResult" and "Result" classes.
5-
Thanks to Duncan Watts (https://github.com/DuncWatts) for lodging the issue.
7+
- Correctly handle the "Legacy authorization refused." login error message.

0 commit comments

Comments
 (0)