Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OAuth2 requiring identify scope, and add ability to quickly list guilds with Nyxx.connectRest #634

Merged
merged 5 commits into from
Mar 8, 2024

Conversation

MCausc78
Copy link
Contributor

@MCausc78 MCausc78 commented Mar 5, 2024

  1. Add ability to quickly list guilds with Nyxx.connectRest/Nyxx.connectOAuth2 (fix Cannot get guild information using OAuth2 #630) (UserGuild structure)
  2. Make Nyxx.connectOAuth2 no longer throw if identify scope is missing

I could make OAuth2Manager class and put fetchCurrentOAuth2Information to it, but its seems overkill

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) (Nyxx.connectOAuth2/Nyxx.connectOAuth2WithOptions no longer throws if there no identify scope)

Checklist:

  • Ran dart analyze or make analyze and fixed all issues
  • Ran dart format --set-exit-if-changed -l 160 ./lib or make format and fixed all issues
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Sorry, something went wrong.

@abitofevrything abitofevrything merged commit 408fe03 into nyxx-discord:dev Mar 8, 2024
3 checks passed
@Lexedia Lexedia added the bug Something isn't working label Mar 21, 2024
@Lexedia Lexedia added this to the 6.2.0 milestone Mar 21, 2024
abitofevrything pushed a commit that referenced this pull request Apr 1, 2024
…t guilds with `Nyxx.connectRest` (#634)

* fix `Nyxx.connectOAuth2` throwing "Unauthorized" exception if `identify` scope missing and replace `listGuilds`/`listCurrentUserGuilds` return types with new `UserGuild` class

* add missing `lib/src/models/oauth2.dart` file

* remove `print` call (left when debugging)

* fix `UserManager.listCurrentUserGuilds` tests

* apply abito changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Cannot get guild information using OAuth2
3 participants