-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OAuth2 requiring
identify
scope, and add ability to quickly lis…
…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
- Loading branch information
Showing
9 changed files
with
161 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:nyxx/src/models/application.dart'; | ||
import 'package:nyxx/src/models/user/user.dart'; | ||
|
||
class OAuth2Information { | ||
/// The current application. | ||
final PartialApplication application; | ||
|
||
/// The scopes the user has authorized the application for. | ||
final List<String> scopes; | ||
|
||
/// When the access token expires. | ||
final DateTime expiresOn; | ||
|
||
/// The user who has authorized, if the user has authorized with the `identify` scope. | ||
final User? user; | ||
|
||
OAuth2Information({required this.application, required this.scopes, required this.expiresOn, this.user}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.