Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/google_sign_in/google_sign_in_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 0.12.2
## 0.12.3

* Re-publishes 0.12.2 with a small fix to the auth code initialization.

## 0.12.2 (withdrawn)

* Adds server auth code retrieval to google_sign_in_web.
* Adds `web_only` library to access web-only methods more easily.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ class GisSdkClient {
onError: _onTokenError,
);

_codeClient = _initializeCodeClient(
clientId,
hostedDomain: hostedDomain,
onResponse: _onCodeResponse,
onError: _onCodeError,
scopes: initialScopes,
);
if (initialScopes.isNotEmpty) {
_codeClient = _initializeCodeClient(
clientId,
hostedDomain: hostedDomain,
onResponse: _onCodeResponse,
onError: _onCodeError,
scopes: initialScopes,
);
}
}

void _logIfEnabled(String message, [List<Object?>? more]) {
Expand Down Expand Up @@ -291,7 +293,12 @@ class GisSdkClient {
/// Requests a server auth code per:
/// https://developers.google.com/identity/oauth2/web/guides/use-code-model#initialize_a_code_client
Future<String?> requestServerAuthCode() async {
_codeClient.requestCode();
assert(_codeClient != null,
'CodeClient not initialized correctly. Ensure the `scopes` list passed to `init()` or `initWithParams()` is not empty!');
if (_codeClient == null) {
return null;
}
_codeClient!.requestCode();
final CodeResponse response = await _codeResponses.stream.first;
return response.code;
}
Expand Down Expand Up @@ -461,7 +468,8 @@ class GisSdkClient {

// The Google Identity Services client for oauth requests.
late TokenClient _tokenClient;
late CodeClient _codeClient;
// CodeClient will not be created if `initialScopes` is empty.
CodeClient? _codeClient;

// Streams of credential and token responses.
late StreamController<CredentialResponse> _credentialResponses;
Expand Down
2 changes: 1 addition & 1 deletion packages/google_sign_in/google_sign_in_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system
for signing in with a Google account on Android, iOS and Web.
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
version: 0.12.2
version: 0.12.3

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down