Improved error message

This commit is contained in:
M66B 2023-12-11 07:29:57 +01:00
parent f5389bef3a
commit e29d3c64d8
1 changed files with 3 additions and 2 deletions

View File

@ -555,11 +555,12 @@ public class FragmentOAuth extends FragmentBase {
long expire = jauthstate.optLong(FAIREMAIL_EXPIRE, -1);
jauthstate.remove(FAIREMAIL_RANDOM);
prefs.edit().remove("oauth." + auth.state).apply();
long now = new Date().getTime();
if (random != returnedRandom)
throw new SecurityException("random " + random + " <> " + returnedRandom);
if (expire < new Date().getTime())
throw new SecurityException("Session expired");
if (expire < now)
throw new SecurityException("Session expired " + new Date(expire) + " < " + new Date(now));
final AuthState authState = AuthState.jsonDeserialize(jauthstate);