storage doesn't get saved after logging in #13

Closed
opened 2023-11-11 21:10:17 +03:00 by teidesu · 0 comments
teidesu commented 2023-11-11 21:10:17 +03:00 (Migrated from github.com)

How to reproduce

import { NodeTelegramClient } from '@mtcute/node'
import { Dispatcher, filters } from '@mtcute/dispatcher'

const tg = new NodeTelegramClient({
    apiId: 3328759,
    apiHash: 'e6bb1e8c05bd21386e33a5d89fe2e966',
    storage: 'bot-data/my-account',
    logLevel: 10
})

tg.run({
    phone: () => tg.input('phone > '),
    code: () => tg.input('code > '),
    password: () => tg.input('password > ')
}, async (self) => {
    console.log(`logged in as ${self.displayName}`)
})

  • run the above code
  • ctrl-c immediately after logging
  • run the code again

Expected

the authorization is persisted

Actual

it is not

## How to reproduce ``` import { NodeTelegramClient } from '@mtcute/node' import { Dispatcher, filters } from '@mtcute/dispatcher' const tg = new NodeTelegramClient({ apiId: 3328759, apiHash: 'e6bb1e8c05bd21386e33a5d89fe2e966', storage: 'bot-data/my-account', logLevel: 10 }) tg.run({ phone: () => tg.input('phone > '), code: () => tg.input('code > '), password: () => tg.input('password > ') }, async (self) => { console.log(`logged in as ${self.displayName}`) }) ``` - run the above code - ctrl-c immediately after logging - run the code again ## Expected the authorization is persisted ## Actual it is not
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: teidesu/mtcute#13
No description provided.