-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SIGN-0001 Sign-In Intergration #62
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package ru.easycode.words504.languages.data.cloud | ||
|
||
import android.content.Context | ||
import com.google.android.gms.auth.api.signin.GoogleSignIn | ||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount | ||
import ru.easycode.words504.domain.HandleError | ||
|
||
interface SignInDataSource { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
suspend fun checkSignIn(): GoogleSignInAccount | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
class Base( | ||
private val context: Context, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. контекст апликейшна подойдет? проверил на юайке? сделай в мейн активити кнопку для проверки |
||
private val errorHandler: HandleError<Exception, Throwable> | ||
) : SignInDataSource { | ||
override suspend fun checkSignIn(): GoogleSignInAccount { | ||
try { | ||
return GoogleSignIn.getLastSignedInAccount(context)!! | ||
} catch (e: Exception) { | ||
throw errorHandler.handle(e) | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.