asfoury/projmag

View on GitHub
app/src/main/java/com/sdp13epfl2021/projmag/database/di/UserIdModule.kt

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
package com.sdp13epfl2021.projmag.database.di

import com.google.firebase.auth.FirebaseAuth
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Named


@Module
@InstallIn(SingletonComponent::class)
object UserIdModule {
    @Provides
    @Named("currentUserId")
    fun provideCurrentUserID(auth: FirebaseAuth): String = auth.uid ?: ""
}