refactor: inject masto instance via nuxt app (#134)
This commit is contained in:
parent
5c60497421
commit
39b005899e
26 changed files with 67 additions and 48 deletions
|
@ -1,9 +1 @@
|
|||
import { login } from 'masto'
|
||||
import { currentUser } from './users'
|
||||
import { DEFAULT_SERVER } from '~/constants'
|
||||
|
||||
// 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,
|
||||
})
|
||||
export const useMasto = () => useNuxtApp().$masto
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue