auth middlewares
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
<template>
|
||||
<section>
|
||||
<h1>/about</h1>
|
||||
</section>
|
||||
</template>
|
||||
@@ -1,3 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
middleware: ['authenticated'],
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<p>/</p>
|
||||
</template>
|
||||
|
||||
@@ -11,6 +11,7 @@ import { loginUser } from '~/lib/api/auth/login';
|
||||
|
||||
definePageMeta({
|
||||
layout: 'auth',
|
||||
middleware: ['not-authenticated'],
|
||||
});
|
||||
|
||||
// TODO: Get this from the backend
|
||||
@@ -86,7 +87,7 @@ function onKeyDown(e: KeyboardEvent) {
|
||||
<Button class="w-full" variant="outline" :disabled="!OPEN_ID"
|
||||
>OpenID Connect</Button
|
||||
>
|
||||
<NuxtLink to="/register" class="w-full">
|
||||
<NuxtLink to="/signup" class="w-full">
|
||||
<Button class="w-full" variant="ghost">Sign up instead</Button>
|
||||
</NuxtLink>
|
||||
</CardFooter>
|
||||
@@ -11,6 +11,7 @@ import { registerUser } from '~/lib/api/auth/register';
|
||||
|
||||
definePageMeta({
|
||||
layout: 'auth',
|
||||
middleware: ['not-authenticated'],
|
||||
});
|
||||
|
||||
const registering = ref(false);
|
||||
@@ -35,7 +36,7 @@ async function submit() {
|
||||
);
|
||||
|
||||
if (success) {
|
||||
await navigateTo({ path: '/login' });
|
||||
await navigateTo({ path: '/signin' });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -90,7 +91,7 @@ async function submit() {
|
||||
@click="submit"
|
||||
>Sign up</Button
|
||||
>
|
||||
<NuxtLink to="/login" class="w-full">
|
||||
<NuxtLink to="/signin" class="w-full">
|
||||
<Button class="w-full" variant="ghost">Sign in instead</Button>
|
||||
</NuxtLink>
|
||||
</CardFooter>
|
||||
@@ -3,6 +3,10 @@ import DirectoryListContextMenu from '~/components/DirectoryListContextMenu.vue'
|
||||
import RenameEntryDialog from '~/components/actions/RenameEntryDialog.vue';
|
||||
import { getWarrenDirectory } from '~/lib/api/warrens';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['authenticated'],
|
||||
});
|
||||
|
||||
const entries = useAsyncData('current-directory', () =>
|
||||
getWarrenDirectory(useWarrenRoute().value)
|
||||
).data;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['authenticated'],
|
||||
});
|
||||
|
||||
const store = useWarrenStore();
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user