login works again

This commit is contained in:
Henry Jameson 2026-01-27 21:55:36 +02:00
commit 83a419caf7
3 changed files with 10 additions and 14 deletions

View file

@ -1,4 +1,5 @@
import { defineStore } from 'pinia'
import { useInstanceStore } from 'src/stores/instance.js'
import {
createApp,
@ -42,9 +43,6 @@ export const useOAuthStore = defineStore('oauth', {
getToken() {
return this.userToken || this.appToken
},
getUserToken() {
return this.userToken
},
},
actions: {
setClientData({ clientId, clientSecret }) {
@ -62,7 +60,7 @@ export const useOAuthStore = defineStore('oauth', {
},
async createApp() {
const { state } = window.vuex
const instance = state.instance.server
const instance = useInstanceStore().server
const app = await createApp(instance)
this.setClientData(app)
return app
@ -82,7 +80,7 @@ export const useOAuthStore = defineStore('oauth', {
},
async getAppToken() {
const { state } = window.vuex
const instance = state.instance.server
const instance = useInstanceStore().server
const res = await getClientToken({
clientId: this.clientId,
clientSecret: this.clientSecret,
@ -98,7 +96,7 @@ export const useOAuthStore = defineStore('oauth', {
if (this.appToken) {
try {
await verifyAppToken({
instance: state.instance.server,
instance: useInstanceStore().server,
appToken: this.appToken,
})
return this.appToken