fix: login with existing account
This commit is contained in:
parent
aa52a5d807
commit
c4fa06d3e7
1 changed files with 1 additions and 0 deletions
|
@ -45,6 +45,7 @@ async function handleAuthSuccess(accountId: string, user: User) {
|
|||
const testMode = client.params.testMode ?? false
|
||||
|
||||
if ($accounts.get().some(it => it.telegramId === user.id)) {
|
||||
await client.close()
|
||||
await deleteAccount(accountId)
|
||||
throw new Error(`Account already exists (user ID: ${user.id})`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue