mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
API call for logout in compomemt
This commit is contained in:
parent
72517bc999
commit
4a8ba8d385
@ -70,6 +70,7 @@
|
||||
<script>
|
||||
import NavbarToggleButton from '@/components/NavbarToggleButton'
|
||||
import VueQrcode from 'vue-qrcode'
|
||||
import loginAPI from '../../apis/loginAPI'
|
||||
|
||||
export default {
|
||||
name: 'sidebar',
|
||||
@ -101,7 +102,8 @@ export default {
|
||||
showSidebar() {
|
||||
this.$sidebar.displaySidebar(true)
|
||||
},
|
||||
logout() {
|
||||
async logout() {
|
||||
//const result = await loginAPI.logout(this.$store.state.session_id)
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push('/login')
|
||||
},
|
||||
|
||||
@ -49,23 +49,19 @@ export const store = new Vuex.Store({
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
login: async ({ dispatch, commit }, data) => {
|
||||
login: ({ dispatch, commit }, data) => {
|
||||
commit('session_id', data.session_id)
|
||||
commit('email', data.email)
|
||||
},
|
||||
passwordReset: async (data) => {},
|
||||
schoepfen: async (data) => {
|
||||
passwordReset: (data) => {},
|
||||
schoepfen: (data) => {
|
||||
// http://localhost/transaction-creations/ajaxCreate
|
||||
},
|
||||
createUser: async ({ commit, dispatch }, data) => {
|
||||
createUser: ({ commit, dispatch }, data) => {
|
||||
commit('session_id', data.session_id)
|
||||
commit('email', data.email)
|
||||
},
|
||||
logout: async ({ commit, state }) => {
|
||||
if (state.session_id) {
|
||||
const result = await loginAPI.logout(state.session_id)
|
||||
// The result can be error, but thats ok with us
|
||||
}
|
||||
logout: ({ commit, state }) => {
|
||||
commit('session_id', null)
|
||||
commit('email', null)
|
||||
sessionStorage.clear()
|
||||
|
||||
@ -37,37 +37,6 @@ export default {
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: 'default', // default|light
|
||||
description: 'Look of the dashboard navbar. Default (Green) or light (gray)',
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
routeName() {
|
||||
const { name } = this.$route
|
||||
return this.capitalizeFirstLetter(name)
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeNotifications: false,
|
||||
showMenu: false,
|
||||
searchModalVisible: false,
|
||||
searchQuery: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1)
|
||||
},
|
||||
toggleNotificationDropDown() {
|
||||
this.activeNotifications = !this.activeNotifications
|
||||
},
|
||||
closeDropDown() {
|
||||
this.activeNotifications = false
|
||||
},
|
||||
logout() {
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push('/login')
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user