reset fast token on login failure
This commit is contained in:
parent
6e562d4cf9
commit
35ee01cb28
|
@ -362,6 +362,11 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable
|
|||
this.fastToken = token;
|
||||
}
|
||||
|
||||
public void resetFastToken() {
|
||||
this.fastMechanism = null;
|
||||
this.fastToken = null;
|
||||
}
|
||||
|
||||
public void resetPinnedMechanism() {
|
||||
this.pinnedMechanism = null;
|
||||
this.pinnedChannelBinding = null;
|
||||
|
|
|
@ -840,7 +840,11 @@ public class XmppConnection implements Runnable {
|
|||
}
|
||||
Log.d(Config.LOGTAG,failure.toString());
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": login failure " + version);
|
||||
//TODO check if we are doing FAST; reset token
|
||||
if (this.saslMechanism instanceof HashedToken) {
|
||||
Log.d(Config.LOGTAG,account.getJid().asBareJid() + ": resetting token");
|
||||
account.resetFastToken();
|
||||
mXmppConnectionService.databaseBackend.updateAccount(account);
|
||||
}
|
||||
if (failure.hasChild("temporary-auth-failure")) {
|
||||
throw new StateChangingException(Account.State.TEMPORARY_AUTH_FAILURE);
|
||||
} else if (failure.hasChild("account-disabled")) {
|
||||
|
|
Loading…
Reference in a new issue