Implement the simplest account manager authentication
This commit is contained in:
@@ -1,22 +1,25 @@
|
||||
package gq.kirmanak.mealient.di
|
||||
|
||||
import android.accounts.AccountManager
|
||||
import android.content.Context
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import gq.kirmanak.mealient.R
|
||||
import gq.kirmanak.mealient.data.auth.AuthDataSource
|
||||
import gq.kirmanak.mealient.data.auth.AuthRepo
|
||||
import gq.kirmanak.mealient.data.auth.AuthStorage
|
||||
import gq.kirmanak.mealient.data.auth.impl.AuthDataSourceImpl
|
||||
import gq.kirmanak.mealient.data.auth.impl.AuthRepoImpl
|
||||
import gq.kirmanak.mealient.data.auth.impl.AuthService
|
||||
import gq.kirmanak.mealient.data.auth.impl.AuthStorageImpl
|
||||
import gq.kirmanak.mealient.data.baseurl.BaseURLStorage
|
||||
import gq.kirmanak.mealient.data.network.RetrofitBuilder
|
||||
import gq.kirmanak.mealient.data.network.ServiceFactory
|
||||
import gq.kirmanak.mealient.data.network.createServiceFactory
|
||||
import gq.kirmanak.mealient.service.auth.AccountManagerInteractor
|
||||
import gq.kirmanak.mealient.service.auth.AccountManagerInteractorImpl
|
||||
import gq.kirmanak.mealient.service.auth.AccountParameters
|
||||
import javax.inject.Singleton
|
||||
|
||||
@@ -26,8 +29,6 @@ interface AuthModule {
|
||||
|
||||
companion object {
|
||||
|
||||
const val ACCOUNT_TYPE = "Mealient"
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAuthServiceFactory(retrofitBuilder: RetrofitBuilder,
|
||||
@@ -54,9 +55,11 @@ interface AuthModule {
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun bindAuthStorage(authStorageImpl: AuthStorageImpl): AuthStorage
|
||||
fun bindAuthRepo(authRepo: AuthRepoImpl): AuthRepo
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun bindAuthRepo(authRepo: AuthRepoImpl): AuthRepo
|
||||
fun bindAccountManagerInteractor(
|
||||
accountManagerInteractorImpl: AccountManagerInteractorImpl
|
||||
): AccountManagerInteractor
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user