forked from loafle/openapi-generator-original
[kotlin][client] only use authentication tokens when they are not null (#4238)
* [kotlin-client] only use authentication tokens when they are not null * [kotlin-client] only use authentication tokens when they are not null
This commit is contained in:
committed by
William Cheng
parent
fbf3d593df
commit
620aa4fd5e
@@ -83,7 +83,9 @@ open class ApiClient(val baseUrl: String) {
|
||||
}
|
||||
}
|
||||
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
||||
requestConfig.headers[Authorization] = "Bearer " + accessToken
|
||||
accessToken?.let { accessToken ->
|
||||
requestConfig.headers[Authorization] = "Bearer " + accessToken
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user