mirror of https://github.com/M66B/FairEmail.git
Improved error message
This commit is contained in:
parent
f5389bef3a
commit
e29d3c64d8
|
@ -555,11 +555,12 @@ public class FragmentOAuth extends FragmentBase {
|
||||||
long expire = jauthstate.optLong(FAIREMAIL_EXPIRE, -1);
|
long expire = jauthstate.optLong(FAIREMAIL_EXPIRE, -1);
|
||||||
jauthstate.remove(FAIREMAIL_RANDOM);
|
jauthstate.remove(FAIREMAIL_RANDOM);
|
||||||
prefs.edit().remove("oauth." + auth.state).apply();
|
prefs.edit().remove("oauth." + auth.state).apply();
|
||||||
|
long now = new Date().getTime();
|
||||||
|
|
||||||
if (random != returnedRandom)
|
if (random != returnedRandom)
|
||||||
throw new SecurityException("random " + random + " <> " + returnedRandom);
|
throw new SecurityException("random " + random + " <> " + returnedRandom);
|
||||||
if (expire < new Date().getTime())
|
if (expire < now)
|
||||||
throw new SecurityException("Session expired");
|
throw new SecurityException("Session expired " + new Date(expire) + " < " + new Date(now));
|
||||||
|
|
||||||
final AuthState authState = AuthState.jsonDeserialize(jauthstate);
|
final AuthState authState = AuthState.jsonDeserialize(jauthstate);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue