diff --git a/frontend/package.json b/frontend/package.json
index 49f2173d5..00e0ca45b 100755
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -65,7 +65,6 @@
"vue-cli-plugin-i18n": "^1.0.1",
"vue-clickaway": "^2.2.2",
"vue-clipboard2": "^0.3.0",
- "vue-cookies": "^1.7.4",
"vue-flatpickr-component": "^8.1.2",
"vue-good-table": "^2.21.3",
"vue-i18n": "^8.22.4",
diff --git a/frontend/src/components/BaseAlert.vue b/frontend/src/components/BaseAlert.vue
index c95da2a32..3349bde50 100644
--- a/frontend/src/components/BaseAlert.vue
+++ b/frontend/src/components/BaseAlert.vue
@@ -69,7 +69,6 @@ export default {
methods: {
dismissAlert() {
this.visible = false
- this.$store.state.loginfail = false
},
},
}
diff --git a/frontend/src/components/SidebarPlugin/SideBar.vue b/frontend/src/components/SidebarPlugin/SideBar.vue
index 054381df8..c1aca6b12 100755
--- a/frontend/src/components/SidebarPlugin/SideBar.vue
+++ b/frontend/src/components/SidebarPlugin/SideBar.vue
@@ -40,10 +40,10 @@
Transactions
@@ -132,6 +132,7 @@ export default {
this.$sidebar.displaySidebar(true)
},
logout() {
+ this.$router.push('/login')
this.$store.dispatch('logout')
},
},
diff --git a/frontend/src/main.js b/frontend/src/main.js
index 03c522655..f1b7ee0c2 100755
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -3,7 +3,6 @@ import DashboardPlugin from './plugins/dashboard-plugin'
import App from './App.vue'
import i18n from './i18n.js'
import VeeValidate from './vee-validate.js'
-import VueCookies from 'vue-cookies'
// store
import { store } from './store/store'
@@ -14,7 +13,6 @@ import router from './routes/router'
// plugin setup
Vue.use(DashboardPlugin)
Vue.config.productionTip = false
-Vue.use(VueCookies)
router.beforeEach((to, from, next) => {
if (to.meta.requiresAuth && !store.state.session_id) {
diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js
index d9128cfc6..8fb6fbb86 100644
--- a/frontend/src/store/store.js
+++ b/frontend/src/store/store.js
@@ -18,7 +18,6 @@ export const store = new Vuex.Store({
language: 'en',
sizeDE: 'normal',
sizeGB: 'big',
- loginfail: false,
user: {
name: '',
balance: 0,
@@ -38,7 +37,6 @@ export const store = new Vuex.Store({
mutations: {
language: (state, language) => {
state.language = language
- $cookies.set('gdd_lang', language)
if (state.language == 'de') {
state.sizeDE = 'big'
state.sizeGB = 'normal'
@@ -47,9 +45,6 @@ export const store = new Vuex.Store({
state.sizeGB = 'big'
}
},
- loginfail: (state, loginfail) => {
- state.loginfail = loginfail
- },
email: (state, email) => {
state.email = email
},
@@ -68,42 +63,26 @@ export const store = new Vuex.Store({
login: async ({ dispatch, commit }, data) => {
commit('session_id', data.session_id)
commit('email', data.email)
- // $cookies.set('gdd_session_id', result.result.data.session_id)
- // $cookies.set('gdd_u', data.email)
},
passwordReset: async (data) => {},
schoepfen: async (data) => {
// http://localhost/transaction-creations/ajaxCreate
},
createUser: async ({ commit, dispatch }, data) => {
- const result = await loginAPI.create(
- data.email,
- data.first_name,
- data.last_name,
- data.password,
- )
- if (result.success) {
- commit('session_id', result.result.data.session_id)
- commit('email', data.email)
- $cookies.set('gdd_session_id', result.result.data.session_id)
- $cookies.set('gdd_u', data.email)
- //router.push('/overview')
- } else {
- // Register failed, we perform a logout
- dispatch('logout')
- }
+ 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
}
- sessionStorage.clear()
commit('session_id', null)
commit('email', null)
+ sessionStorage.clear()
},
accountBalance: async ({ commit, dispatch, state }) => {
- const result = await communityAPI.balance($cookies.get('gdd_session_id'))
+ const result = await communityAPI.balance(state.session_id)
if (result.success) {
commit('user_balance', result.result.data.balance)
} else {
diff --git a/frontend/src/views/KontoOverview.spec.js b/frontend/src/views/KontoOverview.spec.js
index 0e60de370..d2bb8403c 100644
--- a/frontend/src/views/KontoOverview.spec.js
+++ b/frontend/src/views/KontoOverview.spec.js
@@ -1,7 +1,6 @@
import { shallowMount } from '@vue/test-utils'
import KontoOverview from './KontoOverview'
import Vuex from 'vuex'
-import VueCookies from 'vue-cookies'
const localVue = global.localVue
diff --git a/frontend/src/views/KontoOverview.vue b/frontend/src/views/KontoOverview.vue
index c4fd481ac..114e6cf11 100644
--- a/frontend/src/views/KontoOverview.vue
+++ b/frontend/src/views/KontoOverview.vue
@@ -40,7 +40,7 @@ export default {
GddTable,
},
created() {
- this.$store.dispatch('accountBalance', $cookies.get('gdd_session_id'))
+ this.$store.dispatch('accountBalance', this.$store.state.session_id)
},
methods: {
setRows(rows) {
diff --git a/frontend/src/views/Layout/DashboardNavbar.vue b/frontend/src/views/Layout/DashboardNavbar.vue
index e17afe27e..8202e2aa0 100755
--- a/frontend/src/views/Layout/DashboardNavbar.vue
+++ b/frontend/src/views/Layout/DashboardNavbar.vue
@@ -116,8 +116,8 @@ export default {
this.activeNotifications = false
},
logout() {
- this.$store.dispatch('logout')
this.$router.push('/login')
+ this.$store.dispatch('logout')
},
},
}
diff --git a/frontend/src/views/Pages/Login.vue b/frontend/src/views/Pages/Login.vue
index a1ab86401..08f48d9dd 100755
--- a/frontend/src/views/Pages/Login.vue
+++ b/frontend/src/views/Pages/Login.vue
@@ -45,7 +45,7 @@
v-model="model.password"
>
-
+
diff --git a/frontend/src/views/Pages/Register.vue b/frontend/src/views/Pages/Register.vue
index b651d8144..b3ab9ecf5 100755
--- a/frontend/src/views/Pages/Register.vue
+++ b/frontend/src/views/Pages/Register.vue
@@ -141,6 +141,8 @@