Skip to content

Commit 90e0834

Browse files
utkrishtsahupmathew92
authored andcommitted
Address review: remove legacy examples, logLevel, interceptors from docs
1 parent 991b49f commit 90e0834

File tree

2 files changed

+1
-57
lines changed

2 files changed

+1
-57
lines changed

EXAMPLES.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3223,17 +3223,6 @@ account.setNetworkingClient(netClient);
32233223
```
32243224
</details>
32253225

3226-
<details>
3227-
<summary>Legacy constructor (still supported)</summary>
3228-
3229-
```kotlin
3230-
val netClient = DefaultClient(
3231-
connectTimeout = 30,
3232-
readTimeout = 30
3233-
)
3234-
```
3235-
</details>
3236-
32373226
### Logging configuration
32383227

32393228
```kotlin
@@ -3245,12 +3234,11 @@ val account = Auth0.getInstance("{YOUR_CLIENT_ID}", "{YOUR_DOMAIN}")
32453234
account.networkingClient = netClient
32463235
```
32473236

3248-
You can also customize the log level and provide a custom logger:
3237+
You can also provide a custom logger to control where logs are written:
32493238

32503239
```kotlin
32513240
val netClient = DefaultClient.Builder()
32523241
.enableLogging(true)
3253-
.logLevel(HttpLoggingInterceptor.Level.HEADERS) // NONE, BASIC, HEADERS, or BODY (default)
32543242
.logger(HttpLoggingInterceptor.Logger { message -> Log.d("Auth0Http", message) })
32553243
.build()
32563244
```
@@ -3261,23 +3249,12 @@ val netClient = DefaultClient.Builder()
32613249
```java
32623250
DefaultClient netClient = new DefaultClient.Builder()
32633251
.enableLogging(true)
3264-
.logLevel(HttpLoggingInterceptor.Level.HEADERS)
32653252
.build();
32663253
Auth0 account = Auth0.getInstance("client id", "domain");
32673254
account.setNetworkingClient(netClient);
32683255
```
32693256
</details>
32703257

3271-
<details>
3272-
<summary>Legacy constructor (still supported)</summary>
3273-
3274-
```kotlin
3275-
val netClient = DefaultClient(
3276-
enableLogging = true
3277-
)
3278-
```
3279-
</details>
3280-
32813258
### Set additional headers for all requests
32823259

32833260
```kotlin
@@ -3304,37 +3281,6 @@ account.setNetworkingClient(netClient);
33043281
```
33053282
</details>
33063283

3307-
<details>
3308-
<summary>Legacy constructor (still supported)</summary>
3309-
3310-
```kotlin
3311-
val netClient = DefaultClient(
3312-
defaultHeaders = mapOf("{HEADER-NAME}" to "{HEADER-VALUE}")
3313-
)
3314-
```
3315-
</details>
3316-
3317-
### Custom interceptors
3318-
3319-
You can add custom OkHttp interceptors to the `DefaultClient` for use cases such as auth token injection, analytics, or certificate pinning:
3320-
3321-
```kotlin
3322-
val netClient = DefaultClient.Builder()
3323-
.addInterceptor(Interceptor { chain ->
3324-
val request = chain.request().newBuilder()
3325-
.addHeader("X-Request-Id", UUID.randomUUID().toString())
3326-
.build()
3327-
chain.proceed(request)
3328-
})
3329-
.addInterceptor(myAnalyticsInterceptor)
3330-
.build()
3331-
3332-
val account = Auth0.getInstance("{YOUR_CLIENT_ID}", "{YOUR_DOMAIN}")
3333-
account.networkingClient = netClient
3334-
```
3335-
3336-
Interceptors are invoked in the order they were added, after the built-in retry interceptor and before the logging interceptor.
3337-
33383284
### Advanced configuration
33393285

33403286
For more advanced configuration of the networking client, you can provide a custom implementation of `NetworkingClient`. This may be useful when you wish to reuse your own networking client, configure a proxy, etc.

V4_MIGRATION_GUIDE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ val client = DefaultClient.Builder()
120120
.writeTimeout(30)
121121
.callTimeout(120)
122122
.enableLogging(true)
123-
.logLevel(HttpLoggingInterceptor.Level.HEADERS)
124-
.addInterceptor(myCustomInterceptor)
125123
.build()
126124
```
127125

0 commit comments

Comments
 (0)