Skip to content

Instantly share code, notes, and snippets.

@arulwastaken
Created August 7, 2025 16:50
Show Gist options
  • Save arulwastaken/81bc4a0a80fd952cd474eb68f413700e to your computer and use it in GitHub Desktop.
Save arulwastaken/81bc4a0a80fd952cd474eb68f413700e to your computer and use it in GitHub Desktop.
package com.codingwitharul.bill_it.common.auth
import com.codingwitharul.bill_it.common.model.GoogleUser
import io.github.aakira.napier.Napier
import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope
actual class GoogleAuthenticator(val googleOAuth: GoogleOAuthDesktop) {
actual suspend fun login(): Result<GoogleUser?> {
return coroutineScope {
val result = async {
googleOAuth.authenticate()
}
result.await()
}
}
}
package com.codingwitharul.bill_it.common.auth
import androidx.compose.runtime.Composable
actual class GoogleAuthProvider(val oauth: GoogleOAuthDesktop) {
@Composable
actual fun getUiProvider(): GoogleAuthenticator {
return GoogleAuthenticator(oauth)
}
actual suspend fun signOut() {
// custom signOut
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment