Updated on 2026-08-14
This commit is contained in:
parent
ee722c5f46
commit
67a245a19c
18 changed files with 296 additions and 60 deletions
|
|
@ -0,0 +1,12 @@
|
|||
package com.tangem.tap.network.auth
|
||||
|
||||
import com.tangem.common.extensions.toHexString
|
||||
import com.tangem.lib.auth.AuthProvider
|
||||
import com.tangem.tap.proxy.AppStateHolder
|
||||
|
||||
class AuthProviderImpl(private val appStateHolder: AppStateHolder) : AuthProvider {
|
||||
|
||||
override fun getAuthToken(): String {
|
||||
return appStateHolder.scanResponse?.card?.cardPublicKey?.toHexString() ?: ""
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.tangem.tap.network.auth.di
|
||||
|
||||
import com.tangem.lib.auth.AuthProvider
|
||||
import com.tangem.tap.network.auth.AuthProviderImpl
|
||||
import com.tangem.tap.proxy.AppStateHolder
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
class AuthModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAuthProvider(appStateHolder: AppStateHolder): AuthProvider {
|
||||
return AuthProviderImpl(appStateHolder)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue