Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:$rootProject.extJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.espressoCoreVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifeCycleVersion"
implementation "com.google.android.gms:play-services-auth:$rootProject.playServicesVersion"
}

def getDeeplApiKey() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ru.easycode.words504.languages.data.cloud
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Почему логика по логину в гугл акк лежит в пакете languages?


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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Не нравится нейминг: Data Sourcе, судя по названию должен возвращать какие-то данные. Нужно либо название интерфейса исправить, либо название метода check...().


suspend fun checkSignIn(): GoogleSignInAccount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Название метода check...() как-то тоже странно вяжется, судя по тому, что он отдает гугл акк. Нужно подумать над неймингом.


class Base(
private val context: Context,
Copy link
Collaborator

Choose a reason for hiding this comment

The 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)
}
}
}
}
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ ext {
constraintlayoutVersion = '2.1.4'
extJunitVersion = '1.1.5'
espressoCoreVersion = '3.5.1'
playServicesVersion = '20.4.1'
}