Change models, new migrations, fix front and make tests work

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-13 23:33:03 +01:00
parent 92d2045735
commit 20cd1bb579
186 changed files with 2982 additions and 3214 deletions

View File

@@ -10,8 +10,9 @@ import VuexI18n from 'vuex-i18n';
import 'vuetify/dist/vuetify.min.css';
import App from '@/App';
import router from '@/router';
import storeData from './store/index';
import translations from './i18n/index';
import storeData from '@/store/index';
import translations from '@/i18n/index';
import auth from '@/auth';
Vue.config.productionTip = false;
@@ -46,6 +47,19 @@ Object.entries(translations).forEach((key) => {
Vue.i18n.set(language);
Vue.i18n.fallback('en');
router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requiredAuth) && store.state.user === undefined || store.state.user == null) {
next({
name: 'Login',
query: { redirect: to.fullPath }
});
} else {
next();
}
});
auth.getUser(store, () => {}, () => {});
/* eslint-disable no-new */
new Vue({
el: '#app',