#29 refactor: replace admin code with role-based auth using Pinia
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<CodeDialog @code-verified="(verified) => showComponent = verified"/>
|
||||
</div>
|
||||
<ReconciliationJar v-if="showComponent" />
|
||||
<ReconciliationJar v-if="authStore.isAdmin" />
|
||||
</template>
|
||||
|
||||
<script >
|
||||
import CodeDialog from '../components/CodeDialog.vue'
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showComponent: false,
|
||||
setup() {
|
||||
const authStore = useAuthStore();
|
||||
return { authStore };
|
||||
},
|
||||
mounted() {
|
||||
if (!this.authStore.isAdmin) {
|
||||
this.$router.push('/');
|
||||
}
|
||||
},
|
||||
components: { CodeDialog },
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user