slightly better status, internationalization

This commit is contained in:
sam 2023-12-20 03:24:38 +01:00
parent 7c5acad535
commit a06dd22da4
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
22 changed files with 2416 additions and 1009 deletions

View file

@ -6,24 +6,24 @@ import { ref } from "vue";
const localStorageKey = "vulpine-oauth-app";
export const useAppStore = defineStore("oauth-app", () => {
const json = localStorage.getItem(localStorageKey)
const app = ref<Application>(json ? JSON.parse(json) : undefined);
const json = localStorage.getItem(localStorageKey);
const app = ref<Application>(json ? JSON.parse(json) : undefined);
async function getApp() {
if (app.value) return app.value;
async function getApp() {
if (app.value) return app.value;
const resp = await apiFetch<Application>("/api/v1/apps", {
method: "POST",
body: {
client_name: "vulpine-fe",
redirect_uris: `${window.location.origin}/auth/callback`,
scopes: "read write follow push",
}
})
app.value = resp;
localStorage.setItem(localStorageKey, JSON.stringify(resp));
return app.value;
}
const resp = await apiFetch<Application>("/api/v1/apps", {
method: "POST",
body: {
client_name: "vulpine-fe",
redirect_uris: `${window.location.origin}/auth/callback`,
scopes: "read write follow push",
},
});
app.value = resp;
localStorage.setItem(localStorageKey, JSON.stringify(resp));
return app.value;
}
return { app, getApp }
})
return { app, getApp };
});