mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1187 from gradido/catch-no-cookies
feat: Catch No Cookies Allowed
This commit is contained in:
commit
da1e2b2772
@ -30,6 +30,13 @@ loadAllRules(i18n)
|
||||
|
||||
addNavigationGuards(router, store, apolloProvider.defaultClient)
|
||||
|
||||
if (!store) {
|
||||
setTimeout(
|
||||
window.location.assign('https://github.com/gradido/gradido/tree/master/support#cookies'),
|
||||
5000,
|
||||
)
|
||||
}
|
||||
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#app',
|
||||
|
||||
@ -78,32 +78,41 @@ export const actions = {
|
||||
},
|
||||
}
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
plugins: [
|
||||
createPersistedState({
|
||||
storage: window.localStorage,
|
||||
}),
|
||||
],
|
||||
state: {
|
||||
email: '',
|
||||
language: null,
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
username: '',
|
||||
description: '',
|
||||
token: null,
|
||||
isAdmin: false,
|
||||
coinanimation: true,
|
||||
newsletterState: null,
|
||||
community: {
|
||||
name: '',
|
||||
let store
|
||||
|
||||
try {
|
||||
store = new Vuex.Store({
|
||||
plugins: [
|
||||
createPersistedState({
|
||||
storage: window.localStorage,
|
||||
}),
|
||||
],
|
||||
state: {
|
||||
email: '',
|
||||
language: null,
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
username: '',
|
||||
description: '',
|
||||
token: null,
|
||||
isAdmin: false,
|
||||
coinanimation: true,
|
||||
newsletterState: null,
|
||||
community: {
|
||||
name: '',
|
||||
description: '',
|
||||
},
|
||||
hasElopage: false,
|
||||
publisherId: null,
|
||||
},
|
||||
hasElopage: false,
|
||||
publisherId: null,
|
||||
},
|
||||
getters: {},
|
||||
// Syncronous mutation of the state
|
||||
mutations,
|
||||
actions,
|
||||
})
|
||||
getters: {},
|
||||
// Syncronous mutation of the state
|
||||
mutations,
|
||||
actions,
|
||||
})
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
export { store }
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
import { mutations, actions } from './store'
|
||||
import Vuex from 'vuex'
|
||||
import Vue from 'vue'
|
||||
|
||||
jest.mock('vuex')
|
||||
|
||||
const {
|
||||
language,
|
||||
@ -298,4 +302,25 @@ describe('Vuex store', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('creation of store fails', () => {
|
||||
const consoleErrorMock = jest.fn()
|
||||
const warnHandler = Vue.config.warnHandler
|
||||
beforeEach(() => {
|
||||
Vue.config.warnHandler = (w) => {}
|
||||
// eslint-disable-next-line no-console
|
||||
console.error = consoleErrorMock
|
||||
Vuex.Store = () => {
|
||||
throw new Error('no-cookies-allowed')
|
||||
}
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
Vue.config.warnHandler = warnHandler
|
||||
})
|
||||
|
||||
it.skip('logs an error message', () => {
|
||||
expect(consoleErrorMock).toBeCalledWith('no-cookies-allowed')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
6
support/README.md
Normal file
6
support/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
## Cookies
|
||||
|
||||
Die Gradido Wallet benötigt Zugriff auf die local strorage des
|
||||
Browsers. Bitte stelle sicher, dass in deinem Browser Cookies für die
|
||||
Gradido Wallet erlaubt sind.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user