Skip to content

Commit ce6a5a8

Browse files
committed
📝 Updated documentation about grants
1 parent bd02c05 commit ce6a5a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/src/oauth_chopper.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'dart:async';
22

3-
import 'package:oauth2/oauth2.dart';
3+
import 'package:oauth2/oauth2.dart' as oauth2;
44
import 'package:oauth_chopper/src/oauth_authenticator.dart';
55
import 'package:oauth_chopper/src/oauth_grant.dart';
66
import 'package:oauth_chopper/src/oauth_interceptor.dart';
@@ -73,13 +73,13 @@ class OAuthChopper {
7373
Future<OAuthToken?> refresh() async {
7474
final credentialsJson = await _storage.fetchCredentials();
7575
if (credentialsJson == null) return null;
76-
final credentials = Credentials.fromJson(credentialsJson);
76+
final credentials = oauth2.Credentials.fromJson(credentialsJson);
7777
try {
7878
final newCredentials =
7979
await credentials.refresh(identifier: identifier, secret: secret);
8080
await _storage.saveCredentials(newCredentials.toJson());
8181
return OAuthToken.fromCredentials(newCredentials);
82-
} on AuthorizationException {
82+
} on oauth2.AuthorizationException {
8383
_storage.clear();
8484
rethrow;
8585
}
@@ -89,7 +89,7 @@ class OAuthChopper {
8989
/// Currently supported grants:
9090
/// - [ResourceOwnerPasswordGrant]
9191
/// - [ClientCredentialsGrant]
92-
///
92+
/// - [AuthorizationCodeGrant]
9393
/// Throws an exception if the grant fails.
9494
Future<OAuthToken> requestGrant(OAuthGrant grant) async {
9595
final credentials =

0 commit comments

Comments
 (0)