Skip to content

Commit

Permalink
Merge branch 'qasim90-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
okrad committed Jul 17, 2022
2 parents d7d095a + b80f220 commit 820a35d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions lib/oauth2_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ class OAuth2Client {
String? state,
httpClient,
BaseWebAuth? webAuthClient,
Map<String, dynamic>? webAuthOpts}) async {
Map<String, dynamic>? webAuthOpts,
Map<String, dynamic>? customParams}) async {
httpClient ??= http.Client();
webAuthClient ??= this.webAuthClient;

Expand All @@ -94,7 +95,8 @@ class OAuth2Client {
scopes: scopes,
enableState: enableState,
state: state,
redirectUri: redirectUri);
redirectUri: redirectUri,
customParams: customParams);

// Present the dialog to the user
try {
Expand Down Expand Up @@ -163,8 +165,9 @@ class OAuth2Client {
webAuthOpts: webAuthOpts);

if (authResp.isAccessGranted()) {
if (afterAuthorizationCodeCb != null)
if (afterAuthorizationCodeCb != null) {
afterAuthorizationCodeCb(authResp);
}

tknResp = await requestAccessToken(
httpClient: httpClient,
Expand Down
3 changes: 2 additions & 1 deletion lib/oauth2_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ class OAuth2Helper {
scopes: scopes,
enableState: enableState,
webAuthClient: webAuthClient,
webAuthOpts: webAuthOpts);
webAuthOpts: webAuthOpts,
customParams: authCodeParams);
} else {
tknResp = AccessTokenResponse.errorResponse();
}
Expand Down
6 changes: 4 additions & 2 deletions test/oauth2_helper_test.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ class MockOAuth2Client extends _i1.Mock implements _i8.OAuth2Client {
String? state,
dynamic httpClient,
_i2.BaseWebAuth? webAuthClient,
Map<String, dynamic>? webAuthOpts}) =>
Map<String, dynamic>? webAuthOpts,
Map<String, dynamic>? customParams}) =>
(super.noSuchMethod(
Invocation.method(#getTokenWithImplicitGrantFlow, [], {
#clientId: clientId,
Expand All @@ -136,7 +137,8 @@ class MockOAuth2Client extends _i1.Mock implements _i8.OAuth2Client {
#state: state,
#httpClient: httpClient,
#webAuthClient: webAuthClient,
#webAuthOpts: webAuthOpts
#webAuthOpts: webAuthOpts,
#customParams: customParams
}),
returnValue: Future<_i3.AccessTokenResponse>.value(
_FakeAccessTokenResponse_1()))
Expand Down

0 comments on commit 820a35d

Please sign in to comment.