Added Redirect if User is not on Mobile Index
This commit is contained in:
7
middleware/redirectToMobileIndex.ts
Normal file
7
middleware/redirectToMobileIndex.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
if(await useCapacitor().getIsPhone()) {
|
||||||
|
return router.push('/mobile')
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
import DisplayPresentProfiles from "~/components/noAutoLoad/displayPresentProfiles.vue";
|
import DisplayPresentProfiles from "~/components/noAutoLoad/displayPresentProfiles.vue";
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
middleware: "auth"
|
middleware: ["auth","redirect-to-mobile-index"]
|
||||||
})
|
})
|
||||||
|
|
||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
|
|||||||
Reference in New Issue
Block a user