Skip to content

Commit 3e8af3a

Browse files
committed
fix(client): prioritise bearer auth
1 parent 6c97cb5 commit 3e8af3a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,6 @@ private constructor(
437437
headers.put("X-Stainless-Runtime", "JRE")
438438
headers.put("X-Stainless-Runtime-Version", getJavaVersion())
439439
headers.put("Finch-API-Version", "2020-09-17")
440-
accessToken?.let {
441-
if (!it.isEmpty()) {
442-
headers.put("Authorization", "Bearer $it")
443-
}
444-
}
445440
clientId?.let { username ->
446441
clientSecret?.let { password ->
447442
if (!username.isEmpty() && !password.isEmpty()) {
@@ -452,6 +447,11 @@ private constructor(
452447
}
453448
}
454449
}
450+
accessToken?.let {
451+
if (!it.isEmpty()) {
452+
headers.put("Authorization", "Bearer $it")
453+
}
454+
}
455455
headers.replaceAll(this.headers.build())
456456
queryParams.replaceAll(this.queryParams.build())
457457

0 commit comments

Comments
 (0)