elk/plugins/masto.ts

13 lines
254 B
TypeScript
Raw Normal View History

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