fixed retrofit client, but will delete this file after merges
- kept class so nothing will break when merge - then delete after merge buy making other files use Hilt
This commit is contained in:
@@ -7,6 +7,7 @@ import android.util.Log;
|
|||||||
import com.example.petstoremobile.BuildConfig;
|
import com.example.petstoremobile.BuildConfig;
|
||||||
import com.example.petstoremobile.api.auth.AuthApi;
|
import com.example.petstoremobile.api.auth.AuthApi;
|
||||||
import com.example.petstoremobile.api.auth.AuthInterceptor;
|
import com.example.petstoremobile.api.auth.AuthInterceptor;
|
||||||
|
import com.example.petstoremobile.api.auth.TokenManager;
|
||||||
|
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.logging.HttpLoggingInterceptor;
|
import okhttp3.logging.HttpLoggingInterceptor;
|
||||||
@@ -15,7 +16,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
|||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
//Retrofit client Used for API calls
|
//Retrofit client Used for API calls TODO: DELETE THIS FILE AFTER MERGE NOW THAT WE ARE USING HILT AND NETWORKMODULE
|
||||||
public class RetrofitClient {
|
public class RetrofitClient {
|
||||||
private static final String TAG = "RetrofitClient";
|
private static final String TAG = "RetrofitClient";
|
||||||
public static final String BASE_URL = getBaseUrl();
|
public static final String BASE_URL = getBaseUrl();
|
||||||
@@ -50,7 +51,7 @@ public class RetrofitClient {
|
|||||||
|
|
||||||
OkHttpClient client = new OkHttpClient.Builder()
|
OkHttpClient client = new OkHttpClient.Builder()
|
||||||
.addInterceptor(interceptor)
|
.addInterceptor(interceptor)
|
||||||
.addInterceptor(new AuthInterceptor(context))
|
.addInterceptor(new AuthInterceptor(new TokenManager(context)))
|
||||||
.connectTimeout(30, TimeUnit.SECONDS)
|
.connectTimeout(30, TimeUnit.SECONDS)
|
||||||
.readTimeout(30, TimeUnit.SECONDS)
|
.readTimeout(30, TimeUnit.SECONDS)
|
||||||
.writeTimeout(30, TimeUnit.SECONDS)
|
.writeTimeout(30, TimeUnit.SECONDS)
|
||||||
|
|||||||
Reference in New Issue
Block a user