return to inertia logout

This commit is contained in:
saparatayev 2022-03-23 15:52:59 +05:00
parent 54013acf1d
commit 8a543d317a
1 changed files with 3 additions and 8 deletions

View File

@ -28,9 +28,7 @@
<a-button v-if="$page.props.user" class="ml-6" @click="logout">{{
trans("Logout")
}}</a-button>
<form action="/logout" method="post" id="logout-form">
<input type="hidden" name="_token" :value="csrf">
</form>
<!-- <a-button v-else @click="login">Içeri gir</a-button> -->
</div>
<main style="height: calc(100vh - 3.5rem)"><slot></slot></main>
@ -47,9 +45,7 @@ export default {
},
data() {
return {
csrf: document.querySelector('meta[name="csrf-token"]').getAttribute('content')
};
return {};
},
computed: {
@ -110,8 +106,7 @@ export default {
},
logout() {
event.preventDefault()
document.getElementById('logout-form').submit()
this.$inertia.post(this.route("logout"));
},
},
};