Search in sources :

Example 1 with AuthenticationManager

use of org.fundacionparaguaya.adviserplatform.data.remote.AuthenticationManager in project ps-advisor-app by wpi-poverty-stoplight.

the class DatabaseModule method provideAuthManager.

@Provides
@Singleton
AuthenticationManager provideAuthManager(SharedPreferences sharedPreferences, ServerInterceptor serverInterceptor, ConnectivityWatcher connectivityWatcher) {
    Retrofit authRetrofit = new Retrofit.Builder().client(httpBuilder.addInterceptor(serverInterceptor).build()).baseUrl(URL_AUTH_ENDPOINT).addConverterFactory(GsonConverterFactory.create()).build();
    AuthenticationManager authManager = new AuthenticationManager(authRetrofit.create(AuthenticationService.class), sharedPreferences, connectivityWatcher);
    return authManager;
}
Also used : AuthenticationManager(org.fundacionparaguaya.adviserplatform.data.remote.AuthenticationManager) Retrofit(retrofit2.Retrofit) AuthenticationService(org.fundacionparaguaya.adviserplatform.data.remote.AuthenticationService) Singleton(javax.inject.Singleton) Provides(dagger.Provides)

Aggregations

Provides (dagger.Provides)1 Singleton (javax.inject.Singleton)1 AuthenticationManager (org.fundacionparaguaya.adviserplatform.data.remote.AuthenticationManager)1 AuthenticationService (org.fundacionparaguaya.adviserplatform.data.remote.AuthenticationService)1 Retrofit (retrofit2.Retrofit)1