mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-06 04:52:25 -07:00
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Docker Nightly Production / Backend Server Tests (push) Waiting to run
Docker Nightly Production / Frontend Tests (push) Waiting to run
Docker Nightly Production / Build Package (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
Release Drafter / ✏️ Draft release (push) Waiting to run
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com> Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
48 lines
1.2 KiB
Vue
48 lines
1.2 KiB
Vue
<template>
|
|
<div />
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { useAsyncKey } from "~/composables/use-utils";
|
|
import type { AppInfo, AppStartupInfo } from "~/lib/api/types/admin";
|
|
|
|
export default defineNuxtComponent({
|
|
setup() {
|
|
definePageMeta({
|
|
layout: "blank",
|
|
});
|
|
|
|
const $auth = useMealieAuth();
|
|
const { $axios } = useNuxtApp();
|
|
const router = useRouter();
|
|
const groupSlug = computed(() => $auth.user.value?.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");
|
|
}
|
|
}
|
|
|
|
useAsyncData(useAsyncKey(), async () => {
|
|
if (groupSlug.value) {
|
|
const data = await $axios.get<AppStartupInfo>("/api/app/about/startup-info");
|
|
const isDemo = data.data.isDemo;
|
|
const isFirstLogin = data.data.isFirstLogin;
|
|
if (!isDemo && isFirstLogin && $auth.user.value?.admin) {
|
|
router.push("/admin/setup");
|
|
}
|
|
else {
|
|
router.push(`/g/${groupSlug.value}`);
|
|
}
|
|
}
|
|
else {
|
|
redirectPublicUserToDefaultGroup();
|
|
}
|
|
});
|
|
},
|
|
});
|
|
</script>
|