2022-11-23 00:08:36 +01:00
|
|
|
import { login } from 'masto'
|
2022-11-23 05:25:48 +01:00
|
|
|
import { currentUser } from './users'
|
2022-11-23 00:08:36 +01:00
|
|
|
import { DEFAULT_SERVER } from '~/constants'
|
2022-11-13 06:34:43 +01:00
|
|
|
|
2022-11-23 00:08:36 +01:00
|
|
|
// TODO: improve upsteam to make this synchronous (delayed auth)
|
|
|
|
export const masto = await login({
|
|
|
|
url: `https://${currentUser.value?.server || DEFAULT_SERVER}`,
|
|
|
|
accessToken: currentUser.value?.token || undefined,
|
|
|
|
})
|