diff --git a/e2e/deno/tests/01.auth.ts b/e2e/deno/tests/01.auth.ts index 6a0188e6..da739c1d 100644 --- a/e2e/deno/tests/01.auth.ts +++ b/e2e/deno/tests/01.auth.ts @@ -31,7 +31,8 @@ Deno.test('1. authorization', { sanitizeResources: false }, async (t) => { } catch (e) { if ( (e instanceof MtcuteError && e.message.match(/Signup is no longer supported|2FA is enabled/)) || - tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') + tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') || + tl.RpcError.is(e, 'PHONE_NUMBER_FLOOD') ) { // retry with another number await tg.logOut().catch((err) => { @@ -72,7 +73,8 @@ Deno.test('1. authorization', { sanitizeResources: false }, async (t) => { } catch (e) { if ( (e instanceof MtcuteError && e.message.match(/Signup is no longer supported|2FA is enabled/)) || - tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') + tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') || + tl.RpcError.is(e, 'PHONE_NUMBER_FLOOD') ) { // retry with another number continue diff --git a/e2e/node/ts/tests/01.auth.ts b/e2e/node/ts/tests/01.auth.ts index 3b5acac8..5fbfd704 100644 --- a/e2e/node/ts/tests/01.auth.ts +++ b/e2e/node/ts/tests/01.auth.ts @@ -34,7 +34,8 @@ describe('1. authorization', function () { } catch (e) { if ( (e instanceof MtcuteError && e.message.match(/Signup is no longer supported|2FA is enabled/)) || - tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') + tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') || + tl.RpcError.is(e, 'PHONE_NUMBER_FLOOD') ) { // retry with another number await tg.logOut().catch((err) => { @@ -75,7 +76,8 @@ describe('1. authorization', function () { } catch (e) { if ( (e instanceof MtcuteError && e.message.match(/Signup is no longer supported|2FA is enabled/)) || - tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') + tl.RpcError.is(e, 'SESSION_PASSWORD_NEEDED') || + tl.RpcError.is(e, 'PHONE_NUMBER_FLOOD') ) { // retry with another number continue