feat(mobile): add local QR scanning and desktop pairing invitations

This commit is contained in:
yilsem committed 2026-09-08 21:28:24 +03:00
1 parent c1929957a2
commit 4115f1b4c0
17 files changed
+178 -17

No files matched your search

+3
View File
@@ -44,6 +44,7 @@ export function createMobileWindow({ directory, assets, resolveBackend, show = t
}
if (action === 'account.login.check') {
const previous = await vault.load()
if (previous.accountToken || clients.size) throw new Error('Mevcut hesap veya bağlantı sessizce değiştirilemez.')
if (!previous.pendingLogin) throw new Error('Önce giriş başlatın.')
const result = await new AccountClient({ accountToken: previous.pendingLogin.deviceCode }).call('/v1/aiturk/mobile-auth/poll', {})
if (result.state !== 'approved') return { approved: false }
@@ -70,6 +71,8 @@ export function createMobileWindow({ directory, assets, resolveBackend, show = t
return call(`/v1/aiturk/pairings/${params.pairingId}/approve`, { user_code: params.code })
}
if (action === 'devices') return call('/v1/aiturk/mobile/devices')
if (action === 'invite.create') return call('/v1/aiturk/mobile/invites', {})
if (action === 'invite.check') return call('/v1/aiturk/mobile/invites')
if (action === 'device.revoke') {
if (!/^[0-9a-f-]{36}$/.test(params.deviceId) || !Number.isInteger(params.version)) throw new Error('Geçersiz cihaz.')
const result = await call(`/v1/aiturk/devices/${params.deviceId}/revoke`, { expected_version: params.version })