Merge branch 'feat/add_auth_interation' into 'develop'

feat: add authorize_interaction page

Co-authored-by: Lhcfl <Lhcfl@outlook.com>

See merge request firefish/firefish!10702
This commit is contained in:
naskya 2024-03-18 15:45:24 +00:00
commit d967bc087b
3 changed files with 44 additions and 0 deletions

View file

@ -12,6 +12,7 @@ Critical security updates are indicated by the :warning: icon.
- Add a toggleable setting to show a warning when you attempt to post files without alt text
- Fix bugs
- Update documents and example config files
- Added `/authorize_interaction` page, allowing users to jump from a remote Mastodon post/user page to the corresponding page in Firefish (!10702)
## [v20240301](https://firefish.dev/firefish/firefish/-/compare/v20240229...v20240301?from_project_id=7&straight=false)

View file

@ -0,0 +1,38 @@
<template>
<MkLoading v-if="!err" />
<XNotFound v-else />
</template>
<script lang="ts" setup>
import * as os from "@/os";
import { useRouter } from "@/router";
import { userPage } from "@/filters/user";
import { notePage } from "@/filters/note";
import { onMounted, ref, defineAsyncComponent } from "vue";
const XNotFound = defineAsyncComponent(() => import("./not-found.vue"));
const err = ref(false);
const urlParams = new URLSearchParams(window.location.search);
const uri = urlParams.get("uri");
const router = useRouter();
onMounted(() => {
os.api("ap/show", { uri })
.then((res) => {
switch (res.type) {
case "User":
router.push(userPage(res.object));
break;
case "Note":
router.push(notePage(res.object));
break;
default:
err.value = true;
break;
}
})
.catch((error) => {
err.value = true;
});
});
</script>

View file

@ -320,6 +320,11 @@ export const routes = [
component: page(() => import("./pages/follow.vue")),
loginRequired: true,
},
{
path: "/authorize_interaction",
component: page(() => import("./pages/authorize_interaction.vue")),
loginRequired: true,
},
{
path: "/share",
component: page(() => import("./pages/share.vue")),