Add team creation, team join and debug login screen
This commit is contained in:
+30
-1
@@ -1,9 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from '#app';
|
||||
|
||||
definePageMeta({
|
||||
middleware: ['guest']
|
||||
});
|
||||
|
||||
const { fetch } = useUserSession();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
// TODO: remove this lol
|
||||
const { data } = await useFetch('/api/auth/test-list');
|
||||
|
||||
async function login(id: number) {
|
||||
await $fetch(`/api/auth/test?id=${id}`);
|
||||
|
||||
await fetch();
|
||||
|
||||
await router.push(
|
||||
(route.query.to
|
||||
? typeof route.query.to === 'string'
|
||||
? route.query.to
|
||||
: route.query.to[0]
|
||||
: '/') || '/'
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template><h1>login</h1></template>
|
||||
<template>
|
||||
<h1>login</h1>
|
||||
<div class="flex flex-col gap-2" v-if="data">
|
||||
<VaButton v-for="user in data" :key="user.id" @click="login(user.id)"
|
||||
>Login as "{{ user.name }}" {{ user.email }}</VaButton
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user