Skip to content

Commit

Permalink
Correctly Handle "Legacy authorization refused." Login Error
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianJSClark committed Oct 15, 2024
1 parent 24d9fc4 commit 9ebea13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Aydsko.iRacingData/DataClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ private async Task LoginInternalAsync(CancellationToken cancellationToken)
if (loginResult is null || !loginResult.Success)
{
var message = loginResult?.Message ?? $"Login failed with HTTP response \"{loginResponse.StatusCode} {loginResponse.ReasonPhrase}\"";
throw iRacingLoginFailedException.Create(message, loginResult?.VerificationRequired);
throw iRacingLoginFailedException.Create(message, loginResult?.VerificationRequired, string.Equals(loginResult?.Message, "Legacy authorization refused.", StringComparison.OrdinalIgnoreCase));
}

IsLoggedIn = true;
Expand Down
8 changes: 5 additions & 3 deletions src/Aydsko.iRacingData/Package Release Notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
BREAKING CHANGES:

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.

Fixes / Changes:

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

0 comments on commit 9ebea13

Please sign in to comment.