Skip to content

Commit

Permalink
[feat]#107 Application.kt수정
Browse files Browse the repository at this point in the history
googleLogin에 필요한 친구 만들기
  • Loading branch information
cbj0010 committed Feb 8, 2023
1 parent 6a6d6cd commit 802508d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/src/main/java/kr/co/nottodo/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package kr.co.nottodo
import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.kakao.sdk.common.KakaoSdk
import timber.log.Timber

Expand All @@ -12,6 +15,7 @@ class Application : Application() {

setupKakaoSdk()
setupTimber()
auth = Firebase.auth
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO)
}

Expand All @@ -23,4 +27,18 @@ class Application : Application() {
if (BuildConfig.DEBUG)
Timber.plant(Timber.DebugTree())
}

companion object {
lateinit var auth: FirebaseAuth
var email: String? = null
fun checkAuth(): Boolean {
var currentUser = auth.currentUser
return currentUser?.let {
email = currentUser.email
currentUser.isEmailVerified
} ?: let {
false
}
}
}
}

0 comments on commit 802508d

Please sign in to comment.