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

Conversation

MrFunctor
Copy link
Contributor

@MrFunctor MrFunctor commented Apr 3, 2025

Fixes #362 (except for responseType, which is left out as explained here)

@CLAassistant
Copy link

CLAassistant commented Apr 3, 2025

CLA assistant check
All committers have signed the CLA.

@@ -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

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

perhaps get responseType while here...

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

ResponseType left alone for good reason, this is a nice focused fix for scope then

@mikehardy mikehardy merged commit a92b64b into invertase:main Apr 3, 2025
5 of 7 checks passed
@MrFunctor MrFunctor deleted the patch-1 branch April 3, 2025 17:27
@mikehardy
Copy link
Collaborator

https://www.npmjs.com/package/@invertase/react-native-apple-authentication?activeTab=versions

published, thanks for the help

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.

Configuration of Sign in with Apple on Android ignores scope and response type options
3 participants