mirror of
https://github.com/directus/directus.git
synced 2026-01-28 10:08:03 -05:00
Return reactive authenticated flag on login
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<template v-else>
|
||||
<p v-html="$t('continue_as', { name })" />
|
||||
<div class="actions">
|
||||
<router-link :to="signOutLink" class="sign-out">{{ $t('sign_out') }}</router-link>
|
||||
<router-link to="/logout" class="sign-out">{{ $t('sign_out') }}</router-link>
|
||||
<v-button large @click="hydrateAndLogin">{{ $t('continue') }}</v-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -20,10 +20,6 @@ import router from '@/router';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const signOutLink = computed<string>(() => {
|
||||
return `/logout`;
|
||||
});
|
||||
|
||||
const loading = ref(false);
|
||||
const error = ref(null);
|
||||
const name = ref<string | null>(null);
|
||||
@@ -31,7 +27,7 @@ export default defineComponent({
|
||||
|
||||
fetchUser();
|
||||
|
||||
return { name, lastPage, signOutLink, loading, error, hydrateAndLogin };
|
||||
return { name, lastPage, loading, error, hydrateAndLogin };
|
||||
|
||||
async function fetchUser() {
|
||||
loading.value = true;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from '@vue/composition-api';
|
||||
import { defineComponent, computed } from '@vue/composition-api';
|
||||
import LoginForm from './components/login-form/';
|
||||
import ContinueAs from './components/continue-as/';
|
||||
import useAppStore from '../../stores/app';
|
||||
@@ -32,10 +32,10 @@ export default defineComponent({
|
||||
const appStore = useAppStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
|
||||
return {
|
||||
authenticated: appStore.state.authenticated,
|
||||
currentProject: settingsStore.state.settings,
|
||||
};
|
||||
const authenticated = computed(() => appStore.state.authenticated);
|
||||
const currentProject = computed(() => settingsStore.state.settings);
|
||||
|
||||
return { authenticated, currentProject };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user