chore: wip oauth
This commit is contained in:
parent
6755ed6f94
commit
6ea4879190
8 changed files with 75 additions and 10 deletions
|
@ -1,13 +1,19 @@
|
|||
import { login } from 'masto'
|
||||
|
||||
export const DEFAULT_SERVER = 'https://mas.to'
|
||||
export const DEFAULT_SERVER = 'mas.to'
|
||||
|
||||
export default defineNuxtPlugin((nuxt) => {
|
||||
const server = useCookie('nuxtodon-server')
|
||||
const token = useCookie('nuxtodon-token')
|
||||
|
||||
const masto = login({
|
||||
url: server.value || DEFAULT_SERVER,
|
||||
url: `https://${server.value || DEFAULT_SERVER}`,
|
||||
accessToken: token.value,
|
||||
})
|
||||
nuxt.vueApp.provide('masto', masto)
|
||||
|
||||
// Reload the page when the token changes
|
||||
watch(token, () => {
|
||||
location.reload()
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue