In legacy Firebase API, I was using "mFirebase.getAuth().getExpires()" to validate the user session. But in new Firebase 9.0.0 API, I couldn't find such validation.
Right now I'm checking the availability of Auth session as below,
public static boolean hasValidAuthToken() {
return FirebaseAuth.getInstance().getCurrentUser() != null ? true : false;
}
How can I handle this, if the token got expired?
Update: Actually I'm doing custom Authentication. Having Firebase server sdk(java) at server side. By default, auth token will get expire after 1 hour.
Getting following error after token expired,
D/ConnectionRetryHelper: Scheduling retry in 398ms
D/PersistentConnection: pc_0 - Trying to fetch auth token
D/PersistentConnection: pc_0 - Error fetching token: An internal error has occured. [ Internal error. ]
D/PersistentConnection: pc_0 - Scheduling connection attempt
How can I handle this scenario?
Thanks in advance!