2022-11-14 03:20:07 +01:00
|
|
|
import { login } from 'masto'
|
|
|
|
|
|
|
|
export default defineNuxtPlugin((nuxt) => {
|
2022-11-15 16:48:23 +01:00
|
|
|
const { server, token } = useAppCookies()
|
2022-11-15 12:54:07 +01:00
|
|
|
|
2022-11-14 03:20:07 +01:00
|
|
|
const masto = login({
|
2022-11-15 16:48:23 +01:00
|
|
|
url: `https://${server.value}`,
|
2022-11-17 22:32:03 +01:00
|
|
|
accessToken: token.value || undefined,
|
2022-11-14 03:20:07 +01:00
|
|
|
})
|
2022-11-17 22:32:03 +01:00
|
|
|
|
|
|
|
nuxt.$masto = masto
|
2022-11-14 03:20:07 +01:00
|
|
|
})
|