From 47f47837272c8ef8eb275a8f5bbf3ace819eb837 Mon Sep 17 00:00:00 2001 From: Pavel Shapovalov Date: Thu, 22 Jul 2021 10:01:38 +0300 Subject: [PATCH 1/6] obtain serverAuthCode on login --- .../lib/src/types.dart | 11 ++++++++--- .../lib/src/utils.dart | 3 ++- .../google_sign_in_platform_interface/pubspec.yaml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart index 61231d1b70b9..e30966f87598 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart @@ -31,6 +31,7 @@ class GoogleSignInUserData { this.displayName, this.photoUrl, this.idToken, + this.serverAuthCode, }); /// The display name of the signed in user. @@ -66,9 +67,12 @@ class GoogleSignInUserData { /// data. String? idToken; + /// Server auth code used to access Google Login + String? serverAuthCode; + @override - int get hashCode => - hashObjects([displayName, email, id, photoUrl, idToken]); + int get hashCode => hashObjects( + [displayName, email, id, photoUrl, idToken, serverAuthCode]); @override bool operator ==(dynamic other) { @@ -79,7 +83,8 @@ class GoogleSignInUserData { otherUserData.email == email && otherUserData.id == id && otherUserData.photoUrl == photoUrl && - otherUserData.idToken == idToken; + otherUserData.idToken == idToken && + otherUserData.serverAuthCode == serverAuthCode; } } diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart index 4a70ec4d25ef..0d89835fb498 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart @@ -14,7 +14,8 @@ GoogleSignInUserData? getUserDataFromMap(Map? data) { id: data['id']!, displayName: data['displayName'], photoUrl: data['photoUrl'], - idToken: data['idToken']); + idToken: data['idToken'], + serverAuthCode: data['serverAuthCode']); } /// Converts token data coming from native code into the proper platform interface type. diff --git a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml index 75b3d98b562d..25867df6202d 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/plugins/tree/master/packages/google_sign_ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.0.1 +version: 2.0.2 environment: sdk: ">=2.12.0 <3.0.0" From 8d114bbc5aed5fa38d7131eabd953c43545f88cc Mon Sep 17 00:00:00 2001 From: Pavel Shapovalov Date: Thu, 22 Jul 2021 10:22:51 +0300 Subject: [PATCH 2/6] fix changelog --- .../google_sign_in_platform_interface/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md index ee43db685339..20e243cf431e 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.2 + +* Add serverAuthCode attribute to user data + ## 2.0.1 * Updates `init` function in `MethodChannelGoogleSignIn` to parametrize `clientId` property. From 33783f04e85dfca476783e3b117df489a2e333d7 Mon Sep 17 00:00:00 2001 From: Pavel Shapovalov Date: Fri, 23 Jul 2021 12:53:15 +0300 Subject: [PATCH 3/6] tests fix --- .../test/method_channel_google_sign_in_test.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart b/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart index 390c12583a79..fcb443f84293 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart +++ b/packages/google_sign_in/google_sign_in_platform_interface/test/method_channel_google_sign_in_test.dart @@ -13,6 +13,8 @@ const Map kUserData = { "id": "8162538176523816253123", "photoUrl": "https://lh5.googleusercontent.com/photo.jpg", "displayName": "John Doe", + 'idToken': '123', + 'serverAuthCode': '789', }; const Map kTokenData = { From 602a5f5ec1e74085837f646057a6f6f8ecfa0c9b Mon Sep 17 00:00:00 2001 From: Pavel Shapovalov Date: Fri, 8 Oct 2021 11:13:11 +0300 Subject: [PATCH 4/6] version --- packages/google_sign_in/google_sign_in/CHANGELOG.md | 4 ++++ packages/google_sign_in/google_sign_in/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index 6107560ce610..eb4b2778ce07 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.2.0 + +* Add serverAuthCode attribute to user data + ## 5.1.1 * Update minimum Flutter SDK to 2.5 and iOS deployment target to 9.0. diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index aa0a686776fb..609568fb4f10 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. repository: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 5.1.1 +version: 5.2.0 environment: sdk: ">=2.14.0 <3.0.0" From f6ea30196c3a6b1d8245d894e56dc420aebc54ce Mon Sep 17 00:00:00 2001 From: Pavel Shapovalov Date: Fri, 8 Oct 2021 11:14:23 +0300 Subject: [PATCH 5/6] Revert "version" This reverts commit 602a5f5ec1e74085837f646057a6f6f8ecfa0c9b. --- packages/google_sign_in/google_sign_in/CHANGELOG.md | 4 ---- packages/google_sign_in/google_sign_in/pubspec.yaml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index eb4b2778ce07..6107560ce610 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,7 +1,3 @@ -## 5.2.0 - -* Add serverAuthCode attribute to user data - ## 5.1.1 * Update minimum Flutter SDK to 2.5 and iOS deployment target to 9.0. diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index 609568fb4f10..aa0a686776fb 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. repository: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 5.2.0 +version: 5.1.1 environment: sdk: ">=2.14.0 <3.0.0" From bb6607d8b532dab29de0dc536da439c8e9c481c7 Mon Sep 17 00:00:00 2001 From: Pavel Shapovalov Date: Fri, 8 Oct 2021 11:15:04 +0300 Subject: [PATCH 6/6] version fix --- .../google_sign_in_platform_interface/CHANGELOG.md | 2 +- .../google_sign_in_platform_interface/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md index 20e243cf431e..917864173f7d 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.0.2 +## 2.1.0 * Add serverAuthCode attribute to user data diff --git a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml index 25867df6202d..aa41039cdf5a 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/plugins/tree/master/packages/google_sign_ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.0.2 +version: 2.1.0 environment: sdk: ">=2.12.0 <3.0.0"