Skip to content

Commit

Permalink
fix expiry check
Browse files Browse the repository at this point in the history
  • Loading branch information
nbransby committed Oct 4, 2023
1 parent 5893d76 commit a4206bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/android/net/ConnectivityManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ConnectivityManager private constructor() {
override fun onDataChange(data: DataSnapshot) {
when (data.getValue(Boolean::class.java)) {
true -> onAvailable(null)
false -> onLost(null)
else -> onLost(null)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/google/firebase/auth/FirebaseAuth.kt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class FirebaseAuth constructor(val app: FirebaseApp) : InternalAuthProvider {
val source = TaskCompletionSource<GetTokenResult>()
val user = user ?: return Tasks.forException(FirebaseNoSignedInUserException("Please sign in before trying to get a token."))

if (!forceRefresh && user.createdAt + user.expiresIn - 5*60 > System.currentTimeMillis() / 1000) {
if (!forceRefresh && user.createdAt + user.expiresIn*1000 - 5*60*1000 > System.currentTimeMillis() ) {
// Log.i("FirebaseAuth", "returning existing token for user ${user.uid} from getAccessToken")
return Tasks.forResult(GetTokenResult(user.idToken, user.claims))
}
Expand Down

0 comments on commit a4206bf

Please sign in to comment.