Skip to content

Commit a4206bf

Browse files
committed
fix expiry check
1 parent 5893d76 commit a4206bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/android/net/ConnectivityManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ConnectivityManager private constructor() {
2525
override fun onDataChange(data: DataSnapshot) {
2626
when (data.getValue(Boolean::class.java)) {
2727
true -> onAvailable(null)
28-
false -> onLost(null)
28+
else -> onLost(null)
2929
}
3030
}
3131

src/main/java/com/google/firebase/auth/FirebaseAuth.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class FirebaseAuth constructor(val app: FirebaseApp) : InternalAuthProvider {
243243
val source = TaskCompletionSource<GetTokenResult>()
244244
val user = user ?: return Tasks.forException(FirebaseNoSignedInUserException("Please sign in before trying to get a token."))
245245

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

0 commit comments

Comments
 (0)