(rawAccount)
| 278 | return updated; |
| 279 | }, |
| 280 | async linkAccount(rawAccount) { |
| 281 | if (rawAccount.provider !== 'discord') { |
| 282 | throw Error('Unknown account provider'); |
| 283 | } |
| 284 | if (!rawAccount.access_token) { |
| 285 | throw Error('No access token'); |
| 286 | } |
| 287 | const discordAccount = await getDiscordUser({ |
| 288 | accessToken: rawAccount.access_token, |
| 289 | }); |
| 290 | await upsertDiscordAccount({ |
| 291 | id: discordAccount.id, |
| 292 | name: discordAccount.username, |
| 293 | avatar: discordAccount.avatar, |
| 294 | }); |
| 295 | await db.insert(dbAccounts).values({ |
| 296 | id: randomUUID(), |
| 297 | ...rawAccount, |
| 298 | }); |
| 299 | }, |
| 300 | async getUserByAccount(account) { |
| 301 | const dbAccount = |
| 302 | (await db |
nothing calls this directly
no test coverage detected