Skip to content

Commit d4c8825

Browse files
committed
🎨 Formatted code
1 parent 54d2d4f commit d4c8825

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

lib/src/oauth_chopper.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ class OAuthChopper {
5656
/// Get stored [OAuthToken].
5757
Future<OAuthToken?> get token async {
5858
final credentialsJson = await _storage.fetchCredentials();
59-
return credentialsJson != null ? OAuthToken.fromJson(credentialsJson) : null;
59+
return credentialsJson != null
60+
? OAuthToken.fromJson(credentialsJson)
61+
: null;
6062
}
6163

6264
/// Provides an [OAuthAuthenticator] instance.
@@ -98,7 +100,8 @@ class OAuthChopper {
98100
/// - [AuthorizationCodeGrant]
99101
/// Throws an exception if the grant fails.
100102
Future<OAuthToken> requestGrant(OAuthGrant grant) async {
101-
final credentials = await grant.handle(authorizationEndpoint, identifier, secret, httpClient);
103+
final credentials = await grant.handle(
104+
authorizationEndpoint, identifier, secret, httpClient);
102105

103106
await _storage.saveCredentials(credentials);
104107

lib/src/oauth_grant.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class ResourceOwnerPasswordGrant extends OAuthGrant {
1717
final String username;
1818
final String password;
1919

20-
const ResourceOwnerPasswordGrant({required this.username, required this.password});
20+
const ResourceOwnerPasswordGrant(
21+
{required this.username, required this.password});
2122

2223
@override
2324
Future<String> handle(
@@ -88,10 +89,12 @@ class AuthorizationCodeGrant extends OAuthGrant {
8889
tokenEndpoint,
8990
httpClient: httpClient,
9091
);
91-
var authorizationUrl = grant.getAuthorizationUrl(redirectUrl, scopes: scopes);
92+
var authorizationUrl =
93+
grant.getAuthorizationUrl(redirectUrl, scopes: scopes);
9294
await redirect(authorizationUrl);
9395
var responseUrl = await listen(redirectUrl);
94-
oauth.Client client = await grant.handleAuthorizationResponse(responseUrl.queryParameters);
96+
oauth.Client client =
97+
await grant.handleAuthorizationResponse(responseUrl.queryParameters);
9598

9699
return client.credentials.toJson();
97100
}

test/oauth_chopper_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ void main() {
101101
final token = await oauthChopper.requestGrant(grantMock);
102102

103103
// assert
104-
verify(() => grantMock.handle(any(), 'identifier', 'secret', null)).called(1);
104+
verify(() => grantMock.handle(any(), 'identifier', 'secret', null))
105+
.called(1);
105106
verify(() => storageMock.saveCredentials(testJson)).called(1);
106107
expect(token.accessToken, 'accesToken');
107108
expect(token.idToken, 'idToken');

0 commit comments

Comments
 (0)