invertase / invertase/react-native-apple-authentication

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

Open
#353 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.7k
Forks
236
PR merge metrics
No merged PRs in 30d

Description

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);
}
}
```;`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.