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:
Hayden 2023-01-06 11:51:38 -08:00 committed by GitHub
parent 4d98d2174e
commit 5dab70fe7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -312,6 +312,7 @@ export default {
ogSiteName: "Mealie",
},
manifest: {
start_url: "",
lang: "en",
name: "Mealie",
title: "Mealie",

View file

@ -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: "",