Skip to content

Commit 54c9ee0

Browse files
kpeleliskadikraman
authored andcommitted
andorid: Change authorize param order (#286)
* 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
1 parent fa50379 commit 54c9ee0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ export const authorize = ({
7979
];
8080

8181
if (Platform.OS === 'android') {
82+
nativeMethodArguments.push(usePKCE);
8283
nativeMethodArguments.push(clientAuthMethod);
8384
nativeMethodArguments.push(dangerouslyAllowInsecureHttpRequests);
8485
nativeMethodArguments.push(customHeaders);
85-
nativeMethodArguments.push(usePKCE);
8686
}
8787

8888
if (Platform.OS === 'ios') {

index.spec.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ describe('AppAuth', () => {
165165
config.scopes,
166166
config.additionalParameters,
167167
config.serviceConfiguration,
168+
config.usePKCE,
168169
config.clientAuthMethod,
169170
false,
170-
config.customHeaders,
171-
config.usePKCE
171+
config.customHeaders
172172
);
173173
});
174174

@@ -182,10 +182,10 @@ describe('AppAuth', () => {
182182
config.scopes,
183183
config.additionalParameters,
184184
config.serviceConfiguration,
185+
config.usePKCE,
185186
config.clientAuthMethod,
186187
false,
187-
config.customHeaders,
188-
config.usePKCE
188+
config.customHeaders
189189
);
190190
});
191191

@@ -199,10 +199,10 @@ describe('AppAuth', () => {
199199
config.scopes,
200200
config.additionalParameters,
201201
config.serviceConfiguration,
202+
config.usePKCE,
202203
config.clientAuthMethod,
203204
true,
204-
config.customHeaders,
205-
config.usePKCE
205+
config.customHeaders
206206
);
207207
});
208208
});
@@ -220,10 +220,10 @@ describe('AppAuth', () => {
220220
config.scopes,
221221
config.additionalParameters,
222222
config.serviceConfiguration,
223+
config.usePKCE,
223224
config.clientAuthMethod,
224225
false,
225-
customHeaders,
226-
config.usePKCE
226+
customHeaders
227227
);
228228
});
229229
});
@@ -374,10 +374,10 @@ describe('AppAuth', () => {
374374
config.scopes,
375375
config.additionalParameters,
376376
config.serviceConfiguration,
377+
config.usePKCE,
377378
config.clientAuthMethod,
378379
false,
379-
customHeaders,
380-
config.usePKCE
380+
customHeaders
381381
);
382382
});
383383
});

0 commit comments

Comments
 (0)