Skip to content

Commit 129f047

Browse files
authored
chore: Improve readability of method arguments be renaming headers argument to customHeaders (#899)
* chore: rename headers argument to customHeaders to improve readibility * chore: add changeset * lint: typo
1 parent fe38319 commit 129f047

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.changeset/orange-apples-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-app-auth': patch
3+
---
4+
5+
Improve readability of method arguments be renaming `headers` argument to `customHeaders`

android/src/main/java/com/rnappauth/RNAppAuthModule.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ public void prefetchConfiguration(
100100
final ReadableArray scopes,
101101
final ReadableMap serviceConfiguration,
102102
final boolean dangerouslyAllowInsecureHttpRequests,
103-
final ReadableMap headers,
103+
final ReadableMap customHeaders,
104104
final Double connectionTimeoutMillis,
105105
final Promise promise
106106
) {
107107
if (warmAndPrefetchChrome) {
108108
warmChromeCustomTab(reactContext, issuer);
109109
}
110110

111-
this.parseHeaderMap(headers);
111+
this.parseHeaderMap(customHeaders);
112112
final ConnectionBuilder builder = createConnectionBuilder(dangerouslyAllowInsecureHttpRequests, this.authorizationRequestHeaders, connectionTimeoutMillis);
113113
final CountDownLatch fetchConfigurationLatch = new CountDownLatch(1);
114114

@@ -165,10 +165,10 @@ public void register(
165165
final ReadableMap serviceConfiguration,
166166
final Double connectionTimeoutMillis,
167167
final boolean dangerouslyAllowInsecureHttpRequests,
168-
final ReadableMap headers,
168+
final ReadableMap customHeaders,
169169
final Promise promise
170170
) {
171-
this.parseHeaderMap(headers);
171+
this.parseHeaderMap(customHeaders);
172172
final ConnectionBuilder builder = createConnectionBuilder(dangerouslyAllowInsecureHttpRequests, this.registrationRequestHeaders, connectionTimeoutMillis);
173173
final AppAuthConfiguration appAuthConfiguration = this.createAppAuthConfiguration(builder, dangerouslyAllowInsecureHttpRequests, null);
174174
final HashMap<String, String> additionalParametersMap = MapUtil.readableMapToHashMap(additionalParameters);
@@ -238,11 +238,11 @@ public void authorize(
238238
final Boolean usePKCE,
239239
final String clientAuthMethod,
240240
final boolean dangerouslyAllowInsecureHttpRequests,
241-
final ReadableMap headers,
241+
final ReadableMap customHeaders,
242242
final ReadableArray androidAllowCustomBrowsers,
243243
final Promise promise
244244
) {
245-
this.parseHeaderMap(headers);
245+
this.parseHeaderMap(customHeaders);
246246
final ConnectionBuilder builder = createConnectionBuilder(dangerouslyAllowInsecureHttpRequests, this.authorizationRequestHeaders, connectionTimeoutMillis);
247247
final AppAuthConfiguration appAuthConfiguration = this.createAppAuthConfiguration(builder, dangerouslyAllowInsecureHttpRequests, androidAllowCustomBrowsers);
248248
final HashMap<String, String> additionalParametersMap = MapUtil.readableMapToHashMap(additionalParameters);
@@ -331,11 +331,11 @@ public void refresh(
331331
final Double connectionTimeoutMillis,
332332
final String clientAuthMethod,
333333
final boolean dangerouslyAllowInsecureHttpRequests,
334-
final ReadableMap headers,
334+
final ReadableMap customHeaders,
335335
final ReadableArray androidAllowCustomBrowsers,
336336
final Promise promise
337337
) {
338-
this.parseHeaderMap(headers);
338+
this.parseHeaderMap(customHeaders);
339339
final ConnectionBuilder builder = createConnectionBuilder(dangerouslyAllowInsecureHttpRequests, this.tokenRequestHeaders, connectionTimeoutMillis);
340340
final AppAuthConfiguration appAuthConfiguration = createAppAuthConfiguration(builder, dangerouslyAllowInsecureHttpRequests, androidAllowCustomBrowsers);
341341
final HashMap<String, String> additionalParametersMap = MapUtil.readableMapToHashMap(additionalParameters);

0 commit comments

Comments
 (0)