Skip to content

Conversation

@shannah
Copy link
Collaborator

@shannah shannah commented Sep 23, 2025

No description provided.

@shannah shannah requested a review from Copilot September 23, 2025 02:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Google Sign-In implementation to properly handle ID tokens by storing them in the AccessToken object alongside access tokens. The changes ensure that the ID token received from Google Sign-In is preserved and made available through the AccessToken, even when access token retrieval fails.

  • Modifies AccessToken creation to include ID token parameter
  • Preserves ID token in error scenarios where access token retrieval fails
  • Updates token handling to use multi-parameter AccessToken constructor

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

String idToken = json.containsKey("id_token") ? (String) json.get("id_token") : requestIdToken;

// Use the constructor that includes all token fields
setAccessToken(new AccessToken(accessToken, expiresIn, refreshToken, idToken));
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code assumes a 4-parameter AccessToken constructor exists, but this may be a breaking change if the existing AccessToken class doesn't support this constructor signature. Consider verifying that the AccessToken class has been updated to support these parameters.

Suggested change
setAccessToken(new AccessToken(accessToken, expiresIn, refreshToken, idToken));
AccessToken token = new AccessToken(accessToken, expiresIn);
// Set refreshToken and idToken if setters are available
try {
java.lang.reflect.Method setRefreshToken = token.getClass().getMethod("setRefreshToken", String.class);
setRefreshToken.invoke(token, refreshToken);
} catch (Exception e) {
// Setter not available, ignore
}
try {
java.lang.reflect.Method setIdToken = token.getClass().getMethod("setIdToken", String.class);
setIdToken.invoke(token, idToken);
} catch (Exception e) {
// Setter not available, ignore
}
setAccessToken(token);

Copilot uses AI. Check for mistakes.
@shannah shannah merged commit 84e305a into master Sep 23, 2025
1 check passed
@shannah shannah deleted the feature/google-signin-identity-token branch September 23, 2025 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants