fix: add Discord OAuth token exchange logging for production diagnostics #92

Closed
Toutsu wants to merge 0 commits from fix/discord-oauth-diagnostics into main
Owner

Summary

Добавлено логирование ошибок при обмене кода на токен в Discord OAuth, чтобы диагностировать почему в production происходит auth_failed.

Changes

  • DiscordAuthService.ExchangeCodeForTokenAsync теперь логирует StatusCode и тело ответа Discord API при неуспехе
  • Обновлены тесты DiscordAuthServiceTests для нового параметра ILogger
  • Версия поднята до 2.8.1

Test plan

  • dotnet build проходит
  • 265 тестов проходят

Workflow

  • CI passes
  • Code review approved
  • Deployed
  • Release published
## Summary Добавлено логирование ошибок при обмене кода на токен в Discord OAuth, чтобы диагностировать почему в production происходит `auth_failed`. ## Changes - `DiscordAuthService.ExchangeCodeForTokenAsync` теперь логирует `StatusCode` и тело ответа Discord API при неуспехе - Обновлены тесты `DiscordAuthServiceTests` для нового параметра `ILogger` - Версия поднята до `2.8.1` ## Test plan - [x] `dotnet build` проходит - [x] 265 тестов проходят ## Workflow - [ ] CI passes - [ ] Code review approved - [ ] Deployed - [ ] Release published
Toutsu added 1 commit 2026-05-25 12:47:58 +03:00
fix: add Discord OAuth token exchange logging for production diagnostics
PR Checks / test-and-build (pull_request) Failing after 6m20s
7e02e86cd6
- Log status code and response body when Discord /oauth2/token fails
- Helps identify why ExchangeCodeAsync returns null in production

Bump version → 2.8.1

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Toutsu added 1 commit 2026-05-25 13:09:12 +03:00
fix: Discord OAuth CSRF cookie SameSite=None for cross-site callback
PR Checks / test-and-build (pull_request) Successful in 6m34s
72a392e652
- Changed __DiscordOAuthState cookie from SameSite=Strict to SameSite=None
  because Discord redirects from discord.com (cross-site) and Strict
  prevents the cookie from being sent on the callback request.
- Added logging for CSRF validation failure to aid future diagnostics.

Bump version → 2.8.1

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Toutsu closed this pull request 2026-05-25 13:31:33 +03:00
Some checks are pending
PR Checks / test-and-build (pull_request) Successful in 6m34s

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Toutsu/GmRelayBot#92