Remove references to unused auth module code

This commit is contained in:
Maciej Pędzich 2023-06-09 09:15:22 +02:00
parent 79baa75a53
commit 053e4e0302
3 changed files with 5 additions and 32 deletions

View File

@ -1,19 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { useAuth } from '@/composables/useAuth';
import ThemeSwitch from './ThemeSwitch.vue'; import ThemeSwitch from './ThemeSwitch.vue';
const { isLoggedIn, logOut } = useAuth();
const router = useRouter();
const showDrawer = ref(false); const showDrawer = ref(false);
const logOutAndGoToLogIn = async () => {
await logOut();
await router.push('/log-in');
};
</script> </script>
<template> <template>
@ -28,22 +18,7 @@ const logOutAndGoToLogIn = async () => {
<v-navigation-drawer v-model="showDrawer" temporary> <v-navigation-drawer v-model="showDrawer" temporary>
<v-list density="compact" nav> <v-list density="compact" nav>
<v-list-item title="Home" prepend-icon="mdi-home" link to="/" /> <v-list-item title="Home" prepend-icon="mdi-home" link to="/" />
<template v-if="isLoggedIn"> <v-list-item title="Vote" prepend-icon="mdi-vote" link to="/vote" />
<v-list-item title="Vote" prepend-icon="mdi-vote" link to="/vote" />
<v-list-item
title="Log out"
prepend-icon="mdi-logout"
@click="logOutAndGoToLogIn"
/>
</template>
<template v-else>
<v-list-item
title="Log in"
prepend-icon="mdi-login"
link
to="/log-in"
/>
</template>
</v-list> </v-list>
</v-navigation-drawer> </v-navigation-drawer>
</template> </template>

View File

@ -8,11 +8,6 @@ const routes = [
name: 'Home', name: 'Home',
component: Home component: Home
}, },
{
path: '/log-in',
name: 'LogIn',
component: () => import('../views/LogIn.vue')
},
{ {
path: '/vote', path: '/vote',
name: 'Vote', name: 'Vote',

View File

@ -1,7 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from 'vue';
import { useVote } from '@/composables/useVote'; import { useVote } from '@/composables/useVote';
const { photosInCurrentVote } = useVote(); const { photosInCurrentVote, pickPhotosForNewVote } = useVote();
onMounted(pickPhotosForNewVote);
</script> </script>
<template> <template>