use of com.fastaccess.provider.rest.interceptors.AuthenticationInterceptor in project FastHub by k0shk0sh.
the class JsoupProvider method provideOkHttpClient.
private static OkHttpClient provideOkHttpClient() {
if (okHttpClient == null) {
OkHttpClient.Builder client = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
client.addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY));
}
client.addInterceptor(new AuthenticationInterceptor(true));
okHttpClient = client.build();
}
return okHttpClient;
}
use of com.fastaccess.provider.rest.interceptors.AuthenticationInterceptor in project FastHub by k0shk0sh.
the class LoginProvider method provideOkHttpClient.
private static OkHttpClient provideOkHttpClient(@Nullable String authToken, @Nullable String otp) {
OkHttpClient.Builder client = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
client.addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY));
}
client.addInterceptor(new AuthenticationInterceptor(authToken, otp));
return client.build();
}
use of com.fastaccess.provider.rest.interceptors.AuthenticationInterceptor in project FastHub by k0shk0sh.
the class RestProvider method provideOkHttpClient.
public static OkHttpClient provideOkHttpClient() {
if (okHttpClient == null) {
OkHttpClient.Builder client = new OkHttpClient.Builder();
if (BuildConfig.DEBUG) {
client.addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY));
}
client.addInterceptor(new AuthenticationInterceptor());
client.addInterceptor(new PaginationInterceptor());
client.addInterceptor(new ContentTypeInterceptor());
okHttpClient = client.build();
}
return okHttpClient;
}
Aggregations