Skip to content

Commit

Permalink
andorid: Change authorize param order (#286)
Browse files Browse the repository at this point in the history
* andorid: Change authorize param order

This is a bug introduced with the order of the `authorize` function
arguments. `usePKCE` should be moved to the top, in order to be
compliant with the signature of the java function.

* Update tests
  • Loading branch information
kpelelis authored and kadikraman committed Apr 1, 2019
1 parent fa50379 commit 54c9ee0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ export const authorize = ({
];

if (Platform.OS === 'android') {
nativeMethodArguments.push(usePKCE);
nativeMethodArguments.push(clientAuthMethod);
nativeMethodArguments.push(dangerouslyAllowInsecureHttpRequests);
nativeMethodArguments.push(customHeaders);
nativeMethodArguments.push(usePKCE);
}

if (Platform.OS === 'ios') {
Expand Down
20 changes: 10 additions & 10 deletions index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ describe('AppAuth', () => {
config.scopes,
config.additionalParameters,
config.serviceConfiguration,
config.usePKCE,
config.clientAuthMethod,
false,
config.customHeaders,
config.usePKCE
config.customHeaders
);
});

Expand All @@ -182,10 +182,10 @@ describe('AppAuth', () => {
config.scopes,
config.additionalParameters,
config.serviceConfiguration,
config.usePKCE,
config.clientAuthMethod,
false,
config.customHeaders,
config.usePKCE
config.customHeaders
);
});

Expand All @@ -199,10 +199,10 @@ describe('AppAuth', () => {
config.scopes,
config.additionalParameters,
config.serviceConfiguration,
config.usePKCE,
config.clientAuthMethod,
true,
config.customHeaders,
config.usePKCE
config.customHeaders
);
});
});
Expand All @@ -220,10 +220,10 @@ describe('AppAuth', () => {
config.scopes,
config.additionalParameters,
config.serviceConfiguration,
config.usePKCE,
config.clientAuthMethod,
false,
customHeaders,
config.usePKCE
customHeaders
);
});
});
Expand Down Expand Up @@ -374,10 +374,10 @@ describe('AppAuth', () => {
config.scopes,
config.additionalParameters,
config.serviceConfiguration,
config.usePKCE,
config.clientAuthMethod,
false,
customHeaders,
config.usePKCE
customHeaders
);
});
});
Expand Down

0 comments on commit 54c9ee0

Please sign in to comment.