Fix login after session revoke (#3013)
This commit is contained in:
parent
6c9fee5499
commit
cc9a7efbf5
@ -381,7 +381,7 @@ async function handleTerminatedSession() {
|
||||
id: new GramJs.InputUserSelf(),
|
||||
}), undefined, true);
|
||||
} catch (err: any) {
|
||||
if (err.message === 'AUTH_KEY_UNREGISTERED') {
|
||||
if (err.message === 'AUTH_KEY_UNREGISTERED' || err.message === 'SESSION_REVOKED') {
|
||||
onUpdate({
|
||||
'@type': 'updateConnectionState',
|
||||
connectionState: 'connectionStateBroken',
|
||||
|
||||
@ -62,10 +62,6 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => {
|
||||
break;
|
||||
|
||||
case 'error': {
|
||||
if (update.error.message === 'SESSION_REVOKED') {
|
||||
actions.signOut({ forceInitApi: true });
|
||||
}
|
||||
|
||||
Object.values(global.byTabId).forEach(({ id: tabId }) => {
|
||||
const paymentShippingError = getShippingError(update.error);
|
||||
if (paymentShippingError) {
|
||||
|
||||
@ -450,7 +450,7 @@ class MTProtoSender {
|
||||
} catch (e) {
|
||||
// `RPCError` errors except for 'AUTH_KEY_UNREGISTERED' should be handled by the client
|
||||
if (e instanceof RPCError) {
|
||||
if (e.message === 'AUTH_KEY_UNREGISTERED') {
|
||||
if (e.message === 'AUTH_KEY_UNREGISTERED' || e.message === 'SESSION_REVOKED') {
|
||||
// 'AUTH_KEY_UNREGISTERED' for the main sender is thrown when unauthorized and should be ignored
|
||||
this._handleBadAuthKey(true);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user