Describe the bug
Got repeated errors for missing CSRF. Then finally it logged in and worked.
How can I help gather any additional information you might need? Should I bump log level to Debug or Verbose?
See also issue 795 - someone else also encountered this isue.
To Reproduce
Unclear - it is now working, even when I restart P2G.
Expected behavior
Should authenticate
Logs
[02/02/2026 12:00:48 -07:00][FATAL][PelotonAuthApiClient] Failed to authenticate with Peloton.
System.InvalidOperationException: Missing CSRF token
at Peloton.Auth.PelotonAuthApiClient.InitiateAuthFlowAsync(String authorizeUrl, OAuthConfig config) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 149
at Peloton.Auth.PelotonAuthApiClient.PerformOAuthLoginAsync(OAuthConfig config, PelotonSettings pelotonSettings) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 98
at Peloton.Auth.PelotonAuthApiClient.LoginWithOAuthAsync(PelotonSettings settings) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 80
at Peloton.Auth.PelotonAuthApiClient.Authenticate() in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 61
[02/02/2026 12:00:48 -07:00][ERROR][] UI - Failed to load Peloton workouts.
System.InvalidOperationException: Missing CSRF token
at Peloton.Auth.PelotonAuthApiClient.InitiateAuthFlowAsync(String authorizeUrl, OAuthConfig config) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 149
at Peloton.Auth.PelotonAuthApiClient.PerformOAuthLoginAsync(OAuthConfig config, PelotonSettings pelotonSettings) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 98
at Peloton.Auth.PelotonAuthApiClient.LoginWithOAuthAsync(PelotonSettings settings) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 80
at Peloton.Auth.PelotonAuthApiClient.Authenticate() in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 61
[02/02/2026 12:04:34 -07:00][ERROR][] UI - Failed to load Peloton workouts.
Installation (please complete the following information):
- OS: Windows 11, .NET runtime 9.0.11
- Method: EXE from Zip bundle
- Version: 6.0.1
Additional context
Describe the bug
Got repeated errors for missing CSRF. Then finally it logged in and worked.
How can I help gather any additional information you might need? Should I bump log level to Debug or Verbose?
See also issue 795 - someone else also encountered this isue.
To Reproduce
Unclear - it is now working, even when I restart P2G.
Expected behavior
Should authenticate
Logs
[02/02/2026 12:00:48 -07:00][FATAL][PelotonAuthApiClient] Failed to authenticate with Peloton.
System.InvalidOperationException: Missing CSRF token
at Peloton.Auth.PelotonAuthApiClient.InitiateAuthFlowAsync(String authorizeUrl, OAuthConfig config) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 149
at Peloton.Auth.PelotonAuthApiClient.PerformOAuthLoginAsync(OAuthConfig config, PelotonSettings pelotonSettings) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 98
at Peloton.Auth.PelotonAuthApiClient.LoginWithOAuthAsync(PelotonSettings settings) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 80
at Peloton.Auth.PelotonAuthApiClient.Authenticate() in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 61
[02/02/2026 12:00:48 -07:00][ERROR][] UI - Failed to load Peloton workouts.
System.InvalidOperationException: Missing CSRF token
at Peloton.Auth.PelotonAuthApiClient.InitiateAuthFlowAsync(String authorizeUrl, OAuthConfig config) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 149
at Peloton.Auth.PelotonAuthApiClient.PerformOAuthLoginAsync(OAuthConfig config, PelotonSettings pelotonSettings) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 98
at Peloton.Auth.PelotonAuthApiClient.LoginWithOAuthAsync(PelotonSettings settings) in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 80
at Peloton.Auth.PelotonAuthApiClient.Authenticate() in D:\a\peloton-to-garmin\peloton-to-garmin\src\Peloton\Auth\PelotonAuthApiClient.cs:line 61
[02/02/2026 12:04:34 -07:00][ERROR][] UI - Failed to load Peloton workouts.
Installation (please complete the following information):
Additional context