Merge branch 'master' of github.com:gradido/gradido

This commit is contained in:
einhornimmond 2021-04-22 11:55:12 +02:00
commit dea2d9597e
6 changed files with 17 additions and 47 deletions

View File

@ -314,7 +314,7 @@ In case of success returns:
- `registerDirect`: code generated by register for check email
- `register`: code generated by auto-register via elopage for check email
- `info`: can contain additional info strings
- "user hasn't password": if user hasn't set a password yet (for example if he was registered via elopage)
- "user has no password": if user hasn't set a password yet (for example if he was registered via elopage)
- "email already activated": if email was already checked
- `user`: contain user object
- `created`: timestamp on which account was created

View File

@ -102,8 +102,7 @@ export default {
this.$sidebar.displaySidebar(true)
},
logout() {
this.$store.dispatch('logout')
this.$router.push('/login')
this.$emit('logout')
},
},
}

View File

@ -1,7 +1,6 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
import loginAPI from '../apis/loginAPI'
import communityAPI from '../apis/communityAPI'
import createPersistedState from 'vuex-persistedstate'
@ -49,23 +48,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()

View File

@ -1,7 +1,7 @@
<template>
<div class="wrapper">
<notifications></notifications>
<side-bar>
<side-bar @logout="logout">
<template slot="links">
<b-nav-item href="#!" to="/overview">
<b-nav-text class="p-0 text-lg text-muted">{{ $t('send') }}</b-nav-text>
@ -36,6 +36,7 @@
<script>
import PerfectScrollbar from 'perfect-scrollbar'
import 'perfect-scrollbar/css/perfect-scrollbar.css'
import loginAPI from '../../apis/loginAPI'
function hasElement(className) {
return document.getElementsByClassName(className).length > 0
@ -71,6 +72,12 @@ export default {
initScrollbar('sidenav')
}
},
async logout() {
const result = await loginAPI.logout(this.$store.state.session_id)
// do we have to check success?
this.$store.dispatch('logout')
this.$router.push('/login')
},
},
mounted() {
this.initScrollbar()

View File

@ -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')
},
},
}

View File

@ -56,7 +56,7 @@ Poco::JSON::Object* JsonLoginViaEmailVerificationCode::handle(Poco::Dynamic::Var
auto user = session->getNewUser();
if (!user->getModel()->getPasswordHashed()) {
info.add("user hasn't password");
info.add("user has no password");
}
auto update_email_verification_result = session->updateEmailVerification(code);
if (1 == update_email_verification_result) {
@ -69,4 +69,4 @@ Poco::JSON::Object* JsonLoginViaEmailVerificationCode::handle(Poco::Dynamic::Var
return result;
}
}