Skip to content
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

Apple Auth Not working after revoking access to app in iOS Settings (Version ^2.4.0) iOS #353

Open
ibraheem88 opened this issue Sep 18, 2024 · 0 comments

Comments

@ibraheem88
Copy link

When we first use apple auth it works as expected and returns the user info at backend. But after revoking access to app in setting, under Sign in with Apple ID, the backend returns this error:
AppleAuth Error - An error occurred while getting response from Apple's servers: Error: Request failed with status code 400
Also after revoking access it does not show hide my email option like it does in the previous versions of library.
Although it doenot look like a code or configuration issue as it would not have logged user at all. But here is the code:

const handleAppleAuth = async () => {
    let response
    let first_name = null
    let last_name = null
    if (Platform.OS === 'android') {
      response = await appleAuthAndroid.signIn();
      first_name = response.user?.name?.firstName
      last_name = response.user?.name?.lastName
    } else {
      const appleAuthRequestResponse = await appleAuth.performRequest({
        requestedOperation: appleAuth.Operation.LOGIN,
        // Note: it appears putting FULL_NAME first is important, see issue #293
        requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL],
      });
      first_name = appleAuthRequestResponse?.fullName?.givenName
      last_name = appleAuthRequestResponse?.fullName?.familyName
      response = { code: appleAuthRequestResponse.authorizationCode }
    }
    const platform = Platform.OS
    if (response.code) {
      const form = new FormData();
      form.append('code', response.code);
      form.append('first_name', first_name);
      form.append('last_name', last_name);
      form.append('platform', platform);
      const URI = AppleAuth;
      handleAuth(URI, form);
    }
  }
```;`
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

No branches or pull requests

1 participant