diff --git a/.changeset/cuddly-rules-behave.md b/.changeset/cuddly-rules-behave.md new file mode 100644 index 00000000..65bf91c8 --- /dev/null +++ b/.changeset/cuddly-rules-behave.md @@ -0,0 +1,5 @@ +--- +'react-native-app-auth': minor +--- + +#965 remove duplicate state key diff --git a/ios/RNAppAuth.m b/ios/RNAppAuth.m index eb11aa55..6b0e387a 100644 --- a/ios/RNAppAuth.m +++ b/ios/RNAppAuth.m @@ -338,6 +338,9 @@ - (void)authorizeWithConfiguration: (OIDServiceConfiguration *) configuration NSString *codeVerifier = usePKCE ? [[self class] generateCodeVerifier] : nil; NSString *codeChallenge = usePKCE ? [[self class] codeChallengeS256ForVerifier:codeVerifier] : nil; NSString *nonce = useNonce ? additionalParameters[@"nonce"]? additionalParameters[@"nonce"]: [[self class] generateState] : nil ; + + NSMutableDictionary* mutableDict = [additionalParameters mutableCopy]; + [mutableDict removeObjectForKey:@"state"]; // builds authentication request OIDAuthorizationRequest *request = @@ -353,7 +356,7 @@ - (void)authorizeWithConfiguration: (OIDServiceConfiguration *) configuration codeVerifier:codeVerifier codeChallenge:codeChallenge codeChallengeMethod: usePKCE ? OIDOAuthorizationRequestCodeChallengeMethodS256 : nil - additionalParameters:additionalParameters]; + additionalParameters:[mutableDict copy]]; // performs authentication request id appDelegate = (id)[UIApplication sharedApplication].delegate;