fix: potential-pwa-fix-3 (#1992)
* force redirect when authenticated * set start_url to empty string per - https://stackoverflow.com/questions/64608408/workbox-is-precaching-urls-without-revision-info-standalone-true-this-is-gene
This commit is contained in:
parent
4d98d2174e
commit
5dab70fe7e
2 changed files with 12 additions and 2 deletions
|
@ -312,6 +312,7 @@ export default {
|
|||
ogSiteName: "Mealie",
|
||||
},
|
||||
manifest: {
|
||||
start_url: "",
|
||||
lang: "en",
|
||||
name: "Mealie",
|
||||
title: "Mealie",
|
||||
|
|
|
@ -109,8 +109,8 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, useContext, computed, reactive } from "@nuxtjs/composition-api";
|
||||
import { useDark } from "@vueuse/core";
|
||||
import { defineComponent, ref, useContext, computed, reactive, useRouter } from "@nuxtjs/composition-api";
|
||||
import { useDark, whenever } from "@vueuse/core";
|
||||
import { useAppInfo } from "~/composables/api";
|
||||
import { usePasswordField } from "~/composables/use-passwords";
|
||||
import { alert } from "~/composables/use-toast";
|
||||
|
@ -122,8 +122,17 @@ export default defineComponent({
|
|||
const toggleDark = useToggleDarkMode();
|
||||
const isDark = useDark();
|
||||
|
||||
const router = useRouter();
|
||||
const { $auth } = useContext();
|
||||
|
||||
whenever(
|
||||
() => $auth.loggedIn,
|
||||
() => {
|
||||
router.push("/");
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
const form = reactive({
|
||||
email: "",
|
||||
password: "",
|
||||
|
|
Loading…
Reference in a new issue