Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit a09c3f5

Browse files
committed
[force-code-for-refresh-token] Add serverAuthCode to GoogleSignInUserData
1 parent 0a868b4 commit a09c3f5

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.2.0
2+
3+
* Add serverAuthCode to GoogleSignInUserData
4+
15
## 1.1.3
26

37
* Update Flutter SDK constraint.

packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ class GoogleSignInUserData {
2727
/// Uses the given data to construct an instance. Any of these parameters
2828
/// could be null.
2929
GoogleSignInUserData(
30-
{this.displayName, this.email, this.id, this.photoUrl, this.idToken});
30+
{this.displayName,
31+
this.email,
32+
this.id,
33+
this.photoUrl,
34+
this.idToken,
35+
this.serverAuthCode});
3136

3237
/// The display name of the signed in user.
3338
///
@@ -62,9 +67,12 @@ class GoogleSignInUserData {
6267
/// data.
6368
String idToken;
6469

70+
/// An auth code which can be exchanged by a backend server for an access token and refresh token
71+
String serverAuthCode;
72+
6573
@override
66-
int get hashCode =>
67-
hashObjects(<String>[displayName, email, id, photoUrl, idToken]);
74+
int get hashCode => hashObjects(
75+
<String>[displayName, email, id, photoUrl, idToken, serverAuthCode]);
6876

6977
@override
7078
bool operator ==(dynamic other) {
@@ -75,7 +83,8 @@ class GoogleSignInUserData {
7583
otherUserData.email == email &&
7684
otherUserData.id == id &&
7785
otherUserData.photoUrl == photoUrl &&
78-
otherUserData.idToken == idToken;
86+
otherUserData.idToken == idToken &&
87+
otherUserData.serverAuthCode == serverAuthCode;
7988
}
8089
}
8190

packages/google_sign_in/google_sign_in_platform_interface/lib/src/utils.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ GoogleSignInUserData getUserDataFromMap(Map<String, dynamic> data) {
1414
email: data['email'],
1515
id: data['id'],
1616
photoUrl: data['photoUrl'],
17-
idToken: data['idToken']);
17+
idToken: data['idToken'],
18+
serverAuthCode: data['serverAuthCode']);
1819
}
1920

2021
/// Converts token data coming from native code into the proper platform interface type.

packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: A common platform interface for the google_sign_in plugin.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in_platform_interface
44
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
55
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
6-
version: 1.1.3
6+
version: 1.2.0
77

88
dependencies:
99
flutter:

0 commit comments

Comments
 (0)