fix: login with existing account

This commit is contained in:
alina 🌸 2025-01-19 01:52:48 +03:00
parent aa52a5d807
commit c4fa06d3e7
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI

View file

@ -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})`)
}