File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
import hexRgb from ' hex-rgb'
3
3
4
- import { allowedRepos , isAllowedRepo } from ' #shared/repos'
4
+ import { allowedRepos } from ' #shared/repos'
5
5
6
6
const route = useRoute ()
7
- const selectedRepo = computed (() => {
8
- const query = route .query .repo as string | undefined
9
- return query && isAllowedRepo (query ) ? query : ' nuxt/nuxt'
10
- })
7
+ const selectedRepo = computed (() => route .query .repo || ' nuxt/nuxt' )
11
8
12
9
useSeoMeta ({
13
10
title: ' unsight.dev' ,
Original file line number Diff line number Diff line change
1
+ import { isAllowedRepo } from '#shared/repos'
2
+
3
+ export default defineNuxtPlugin ( ( ) => {
4
+ useRouter ( ) . beforeEach ( ( to ) => {
5
+ if ( to . query . repo && ! isAllowedRepo ( to . query . repo as string ) ) {
6
+ return navigateTo ( '/' )
7
+ }
8
+ } )
9
+ } )
You can’t perform that action at this time.
0 commit comments