Clean Canvas and resolve bug

This commit is contained in:
2025-03-03 12:20:49 +01:00
parent 934872a753
commit 10c28cac0d
6 changed files with 1322 additions and 715 deletions

View File

@@ -6,7 +6,9 @@
{{ user.name + " " + user.surname }}
</span>
<!-- <button @click="redirectProject()" class="p-button p-button-outlined">Projects</button> -->
<button @click="auth.logout()" class="p-button p-button-outlined">Logout</button>
<!-- <button @click="auth.logout()" class="p-button p-button-outlined">Logout</button> -->
<button @click="logout()" class="p-button p-button-outlined">Logout</button>
</div>
</div>
</template>
@@ -16,14 +18,26 @@
import { useAuth } from '@websanova/vue-auth/src/v3.js';
import { computed } from 'vue';
import { useRouter } from 'vue-router';
import { ScenarioStore } from '@/stores/ScenarioStore';
const auth = useAuth();
const user = computed(() => auth.user());
const router = useRouter();
const scenario_store = ScenarioStore();
function redirectProject() {
router.push('/projects'); // Specifica il percorso per la pagina "Projects"
}
function logout() {
auth.logout().then(() => {
scenario_store.resetStore();
router.push('/auth/login');
}).catch(err => {
console.error("Errore durante il logout:", err);
});
}
</script>