mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-21 14:19:41 +02:00
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Docker Nightly Production / Backend Server Tests (push) Waiting to run
Docker Nightly Production / Frontend and End-to-End Tests (push) Waiting to run
Docker Nightly Production / Build Tagged Release (push) Blocked by required conditions
Docker Nightly Production / Notify Discord (push) Blocked by required conditions
* add default group slug to app info if public * redirect public user to default group * added tests --------- Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
32 lines
824 B
Vue
32 lines
824 B
Vue
<template>
|
|
<div></div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { computed, defineComponent, useContext, useRouter } from "@nuxtjs/composition-api";
|
|
import { AppInfo } from "~/lib/api/types/admin";
|
|
|
|
export default defineComponent({
|
|
layout: "blank",
|
|
setup() {
|
|
const { $auth, $axios } = useContext();
|
|
const router = useRouter();
|
|
const groupSlug = computed(() => $auth.user?.groupSlug);
|
|
|
|
async function redirectPublicUserToDefaultGroup() {
|
|
const { data } = await $axios.get<AppInfo>("/api/app/about");
|
|
if (data?.defaultGroupSlug) {
|
|
router.push(`/g/${data.defaultGroupSlug}`);
|
|
} else {
|
|
router.push("/login");
|
|
}
|
|
}
|
|
|
|
if (groupSlug.value) {
|
|
router.push(`/g/${groupSlug.value}`);
|
|
} else {
|
|
redirectPublicUserToDefaultGroup();
|
|
}
|
|
}
|
|
});
|
|
</script>
|