Created
August 7, 2025 16:50
-
-
Save arulwastaken/81bc4a0a80fd952cd474eb68f413700e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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