From f0014cfce452a092c4990d17c1988dc149654fb2 Mon Sep 17 00:00:00 2001 From: Joe Hobson Date: Wed, 15 May 2024 15:03:52 +0100 Subject: [PATCH 1/2] fix: remove duplicate state --- ios/RNAppAuth.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; From 14f2eabba6a9b98766ddab27619a2ee1264b7e3c Mon Sep 17 00:00:00 2001 From: Joe Hobson Date: Wed, 15 May 2024 15:30:24 +0100 Subject: [PATCH 2/2] Create cuddly-rules-behave.md --- .changeset/cuddly-rules-behave.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/cuddly-rules-behave.md 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