Skip to content

fix(android): pass the specified scope when creating configuration #363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void configure(ReadableMap configObject) {
.clientId(clientId)
.redirectUri(redirectUri)
.responseType(SignInWithAppleConfiguration.ResponseType.ALL)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.responseType(SignInWithAppleConfiguration.ResponseType.ALL)
.responseType(responseType)

as long as we're in here - appears the exact same oversight happened with responseType

  • it gets a default value at the top in var responseType
  • the config is checked to see if it exists, and if it exists then the config value is set into responseType
  • then all that is completely ignored and ALL is used

worth fixing? What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I explained here my reasoning related to responseType. Fixing it is not as simple as that...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even if we ignore the fact that appleAuthAndroid.ResponseType.ID_TOKEN is not valid, and fix that single line of code (i.e., passing .responseType(responseType)), it would still be a breaking change as existing code that is currently explicitly setting the responseType to SignInWithAppleConfiguration.ResponseType.ID_TOKEN would all of a sudden break because passing just id_token in the request to Apple would result in an error during Sign in with Apple.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I'm sorry! Only saw that comment you left with your reasoning just now. Agreed, leave for now

.scope(SignInWithAppleConfiguration.Scope.ALL)
.scope(scope)
.state(state)
.rawNonce(rawNonce)
.nonce(nonce)
Expand Down
Loading