added session_limit, adapted ajax calls (axios interceptor) in theme
This commit is contained in:
parent
d26e21b5a5
commit
a352b9745b
|
@ -137,6 +137,7 @@
|
||||||
"drupal/search_api_page": "^1.x-dev",
|
"drupal/search_api_page": "^1.x-dev",
|
||||||
"drupal/search_api_solr": "^4.1",
|
"drupal/search_api_solr": "^4.1",
|
||||||
"drupal/select_translation": "^1.x-dev",
|
"drupal/select_translation": "^1.x-dev",
|
||||||
|
"drupal/session_limit": "^2.0@beta",
|
||||||
"drupal/simplenews": "^2.0@beta",
|
"drupal/simplenews": "^2.0@beta",
|
||||||
"drupal/social_media_links": "^2.8",
|
"drupal/social_media_links": "^2.8",
|
||||||
"drupal/string_translation_ui": "^1.2",
|
"drupal/string_translation_ui": "^1.2",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "957ca05105e223d75024ee67bb653c06",
|
"content-hash": "d266fe2b9e10650e36671e119f2fb2fb",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "alchemy/zippy",
|
"name": "alchemy/zippy",
|
||||||
|
@ -12237,6 +12237,58 @@
|
||||||
"source": "https://git.drupalcode.org/project/select_translation"
|
"source": "https://git.drupalcode.org/project/select_translation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "drupal/session_limit",
|
||||||
|
"version": "2.0.0-beta2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.drupalcode.org/project/session_limit.git",
|
||||||
|
"reference": "2.0.0-beta2"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://ftp.drupal.org/files/projects/session_limit-2.0.0-beta2.zip",
|
||||||
|
"reference": "2.0.0-beta2",
|
||||||
|
"shasum": "05f6bb02c2d108212b7c2072e5596df919afd09d"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"drupal/core": "^8 || ^9"
|
||||||
|
},
|
||||||
|
"type": "drupal-module",
|
||||||
|
"extra": {
|
||||||
|
"drupal": {
|
||||||
|
"version": "2.0.0-beta2",
|
||||||
|
"datestamp": "1625122061",
|
||||||
|
"security-coverage": {
|
||||||
|
"status": "not-covered",
|
||||||
|
"message": "Beta releases are not covered by Drupal security advisories."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packages.drupal.org/8/downloads",
|
||||||
|
"license": [
|
||||||
|
"GPL-2.0-or-later"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "deekayen",
|
||||||
|
"homepage": "https://www.drupal.org/user/972"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "johnennew",
|
||||||
|
"homepage": "https://www.drupal.org/user/1150042"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "suzymasri",
|
||||||
|
"homepage": "https://www.drupal.org/user/2428842"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Limit simultaneous user sessions.",
|
||||||
|
"homepage": "https://www.drupal.org/project/session_limit",
|
||||||
|
"support": {
|
||||||
|
"source": "https://git.drupalcode.org/project/session_limit"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "drupal/simplenews",
|
"name": "drupal/simplenews",
|
||||||
"version": "2.0.0-beta2",
|
"version": "2.0.0-beta2",
|
||||||
|
@ -21819,6 +21871,7 @@
|
||||||
"drupal/payment_commerce": 20,
|
"drupal/payment_commerce": 20,
|
||||||
"drupal/search_api_page": 20,
|
"drupal/search_api_page": 20,
|
||||||
"drupal/select_translation": 20,
|
"drupal/select_translation": 20,
|
||||||
|
"drupal/session_limit": 10,
|
||||||
"drupal/simplenews": 10,
|
"drupal/simplenews": 10,
|
||||||
"drupal/strings_i18n_json_export": 20,
|
"drupal/strings_i18n_json_export": 20,
|
||||||
"drupal/swiftmailer": 20,
|
"drupal/swiftmailer": 20,
|
||||||
|
|
|
@ -181,6 +181,7 @@ module:
|
||||||
search_api_solr_admin: 0
|
search_api_solr_admin: 0
|
||||||
select_translation: 0
|
select_translation: 0
|
||||||
serialization: 0
|
serialization: 0
|
||||||
|
session_limit: 0
|
||||||
simplenews: 0
|
simplenews: 0
|
||||||
smart_trim: 0
|
smart_trim: 0
|
||||||
smtp: 0
|
smtp: 0
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
session_limit_max: 1
|
||||||
|
session_limit_masquerade_ignore: false
|
||||||
|
session_limit_behaviour: 1
|
||||||
|
session_limit_logged_out_message_severity: warning
|
||||||
|
session_limit_roles:
|
||||||
|
unverified: 0
|
||||||
|
authenticated: 0
|
||||||
|
free_user: 0
|
||||||
|
contact_company: 0
|
||||||
|
alpha_testeur: 0
|
||||||
|
student: 0
|
||||||
|
adherent: 0
|
||||||
|
translator: 0
|
||||||
|
admin_showroom: 0
|
||||||
|
admin: -1
|
||||||
|
root: -1
|
||||||
|
session_limit_admin_inclusion: 0
|
||||||
|
_core:
|
||||||
|
default_config_hash: E99p-j2YC4tVqQ7Gz4-I4cALOq2a8XHkvlQnxoV5EWY
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -4,4 +4,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
${m()}
|
${m()}
|
||||||
`;l.E.post("",{query:(0,r.S)(e)}).then((({data:{data:{article:e}}})=>{this.parseDataGQL(e)})).catch((e=>{console.warn("Issue with loadArticle",e),Promise.reject(e)}))},parseDataGQL(e){this.article=e,this.items.length?this.getIndex():this.getItems().then((()=>{this.getIndex()})),this.image_accroche=e.images[0],this.lightbox_items=[];for(let t=0;t<e.images.length;t++)e.images[t].thumb=e.images[t].style_articlecardmedium.url,this.lightbox_items.push(e.images[t]);for(let t=0;t<e.videos.length;t++){let i=e.videos[t].url,n=null,a=null;switch(/https:\/\/(www\.)?(?<provider>youtube|vimeo)\.com\/.+/.exec(i).groups.provider){case"vimeo":n=/https:\/\/vimeo\.com\/(?<id>\d+)/.exec(i).groups.id||null,a="http://blogpeda.ac-poitiers.fr/ent-lyc/files/2015/06/Vimeo_icon_block.png";break;case"youtube":n=/https:\/\/(www\.)?youtube\.com\/watch\?v=(?<id>.+)/.exec(i).groups.id||null,a="http://img.youtube.com/vi/"+n+"/0.jpg"}this.lightbox_items.push({url:i,title:"",description:"",thumb:a})}this.lightbox_items,this.$store.commit("Common/setPagetitle",e.title),this.loading=!1},onPrevNext(e){let t=e.view_node.replace(/^\/\D{2,3}\/blabla\//g,"");this.$router.push({name:"article",params:{alias:t,id:e.nid}})},setLightboxIndex(e){this.lightbox_index=e}},components:{Card:u.Z},watch:{$route(e,t){this.getArticle()}}};var h=(0,i(1900).Z)(g,n,[],!1,null,"74fbee19",null);h.options.__file="web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue";const _=h.exports}}]);
|
`;l.Z.post("",{query:(0,r.S)(e)}).then((({data:{data:{article:e}}})=>{this.parseDataGQL(e)})).catch((e=>{console.warn("Issue with loadArticle",e),Promise.reject(e)}))},parseDataGQL(e){this.article=e,this.items.length?this.getIndex():this.getItems().then((()=>{this.getIndex()})),this.image_accroche=e.images[0],this.lightbox_items=[];for(let t=0;t<e.images.length;t++)e.images[t].thumb=e.images[t].style_articlecardmedium.url,this.lightbox_items.push(e.images[t]);for(let t=0;t<e.videos.length;t++){let i=e.videos[t].url,n=null,a=null;switch(/https:\/\/(www\.)?(?<provider>youtube|vimeo)\.com\/.+/.exec(i).groups.provider){case"vimeo":n=/https:\/\/vimeo\.com\/(?<id>\d+)/.exec(i).groups.id||null,a="http://blogpeda.ac-poitiers.fr/ent-lyc/files/2015/06/Vimeo_icon_block.png";break;case"youtube":n=/https:\/\/(www\.)?youtube\.com\/watch\?v=(?<id>.+)/.exec(i).groups.id||null,a="http://img.youtube.com/vi/"+n+"/0.jpg"}this.lightbox_items.push({url:i,title:"",description:"",thumb:a})}this.lightbox_items,this.$store.commit("Common/setPagetitle",e.title),this.loading=!1},onPrevNext(e){let t=e.view_node.replace(/^\/\D{2,3}\/blabla\//g,"");this.$router.push({name:"article",params:{alias:t,id:e.nid}})},setLightboxIndex(e){this.lightbox_index=e}},components:{Card:u.Z},watch:{$route(e,t){this.getArticle()}}};var h=(0,i(1900).Z)(g,n,[],!1,null,"74fbee19",null);h.options.__file="web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue";const _=h.exports}}]);
|
Binary file not shown.
|
@ -4,4 +4,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
${c()}
|
${c()}
|
||||||
`;l.E.post("",{query:(0,d.S)(e)}).then((({data:{data:{thematique:e}}})=>{this.parseDataGQL(e)})).catch((e=>{console.warn("Issue with loadThematique",e),Promise.reject(e)}))},parseDataGQL(e){e?(this.thematique=e,e.images&&(this.image_accroche=e.images[0]),this.$store.commit("Common/setPagetitle",e.title)):console.warn("Thematique not loaded"),this.loading=!1}},components:{Card:u.Z},watch:{$route(e,t){this.getThematique()}}};var g=(0,i(1900).Z)(h,a,[],!1,null,"128bc334",null);g.options.__file="web/themes/custom/materiotheme/vuejs/components/Pages/Thematique.vue";const _=g.exports}}]);
|
`;l.Z.post("",{query:(0,d.S)(e)}).then((({data:{data:{thematique:e}}})=>{this.parseDataGQL(e)})).catch((e=>{console.warn("Issue with loadThematique",e),Promise.reject(e)}))},parseDataGQL(e){e?(this.thematique=e,e.images&&(this.image_accroche=e.images[0]),this.$store.commit("Common/setPagetitle",e.title)):console.warn("Thematique not loaded"),this.loading=!1}},components:{Card:u.Z},watch:{$route(e,t){this.getThematique()}}};var g=(0,i(1900).Z)(h,a,[],!1,null,"128bc334",null);g.options.__file="web/themes/custom/materiotheme/vuejs/components/Pages/Thematique.vue";const _=g.exports}}]);
|
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -58,7 +58,7 @@ import 'slim-select/slimselect.min.css'
|
||||||
import 'theme/assets/styles/main.scss'
|
import 'theme/assets/styles/main.scss'
|
||||||
import 'theme/assets/styles/print.scss'
|
import 'theme/assets/styles/print.scss'
|
||||||
|
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
|
|
||||||
export let _v_sitebranding_block, _v_user_block, _v_header_menu,
|
export let _v_sitebranding_block, _v_user_block, _v_header_menu,
|
||||||
_v_pagetitle_block, _v_search_block,
|
_v_pagetitle_block, _v_search_block,
|
||||||
|
|
|
@ -5,7 +5,7 @@ import axios from 'axios'
|
||||||
// console.log('drupalSettings', drupalSettings)
|
// console.log('drupalSettings', drupalSettings)
|
||||||
console.log(window.location)
|
console.log(window.location)
|
||||||
|
|
||||||
export const MGQ = axios.create({
|
const MGQ = axios.create({
|
||||||
baseURL: window.location.origin + '/mgq',
|
baseURL: window.location.origin + '/mgq',
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -15,3 +15,19 @@ export const MGQ = axios.create({
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
MGQ.interceptors.response.use(
|
||||||
|
response => {
|
||||||
|
return Promise.resolve(response)
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
const { status } = error.response
|
||||||
|
console.warn('error in graphql-axios', status)
|
||||||
|
if (status === 403) {
|
||||||
|
window.location = '/'
|
||||||
|
}
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export default MGQ
|
||||||
|
|
|
@ -5,7 +5,7 @@ import axios from 'axios'
|
||||||
// console.log('drupalSettings', drupalSettings)
|
// console.log('drupalSettings', drupalSettings)
|
||||||
console.log(window.location)
|
console.log(window.location)
|
||||||
|
|
||||||
export const JSONAPI = axios.create({
|
const JSONAPI = axios.create({
|
||||||
baseURL: window.location.origin+`/jsonapi`,
|
baseURL: window.location.origin+`/jsonapi`,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -14,3 +14,19 @@ export const JSONAPI = axios.create({
|
||||||
// 'Content-Type': 'application/json'
|
// 'Content-Type': 'application/json'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
JSONAPI.interceptors.response.use(
|
||||||
|
response => {
|
||||||
|
return Promise.resolve(response)
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
const { status } = error.response
|
||||||
|
console.warn('error in json-axios', status)
|
||||||
|
if (status === 403) {
|
||||||
|
window.location = '/'
|
||||||
|
}
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export default JSONAPI
|
||||||
|
|
|
@ -4,7 +4,7 @@ import axios from 'axios'
|
||||||
|
|
||||||
// console.log('drupalSettings', drupalSettings)
|
// console.log('drupalSettings', drupalSettings)
|
||||||
|
|
||||||
export const MA = axios.create({
|
const MA = axios.create({
|
||||||
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -12,3 +12,21 @@ export const MA = axios.create({
|
||||||
// "X-CSRF-Token": "csrf_token"
|
// "X-CSRF-Token": "csrf_token"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
MA.interceptors.response.use(
|
||||||
|
response => {
|
||||||
|
// console.log('ma-axios interceptor response', response)
|
||||||
|
return Promise.resolve(response)
|
||||||
|
// return response
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
const { status } = error.response
|
||||||
|
console.warn('error in ma-axios interceptor', status)
|
||||||
|
if (status === 403) {
|
||||||
|
window.location = '/'
|
||||||
|
}
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export default MA
|
||||||
|
|
|
@ -5,7 +5,7 @@ import axios from 'axios'
|
||||||
// console.log('drupalSettings', drupalSettings)
|
// console.log('drupalSettings', drupalSettings)
|
||||||
// console.log('window.location.origin', window.location.origin)
|
// console.log('window.location.origin', window.location.origin)
|
||||||
|
|
||||||
export const REST = axios.create({
|
const REST = axios.create({
|
||||||
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -13,3 +13,19 @@ export const REST = axios.create({
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
REST.interceptors.response.use(
|
||||||
|
response => {
|
||||||
|
return Promise.resolve(response)
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
const { status } = error.response
|
||||||
|
console.warn('error in rest-axios', status)
|
||||||
|
if (status === 403) {
|
||||||
|
window.location = '/'
|
||||||
|
}
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
export default REST
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<script>
|
<script>
|
||||||
import SearchForm from 'vuejs/components/Form/SearchForm'
|
import SearchForm from 'vuejs/components/Form/SearchForm'
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['blockid', 'formhtml'],
|
props: ['blockid', 'formhtml'],
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { mapState, mapActions } from 'vuex'
|
||||||
import LoginBlock from 'vuejs/components/Block/LoginBlock'
|
import LoginBlock from 'vuejs/components/Block/LoginBlock'
|
||||||
import UserTools from 'vuejs/components/User/UserTools'
|
import UserTools from 'vuejs/components/User/UserTools'
|
||||||
|
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['title', 'loginblock'],
|
props: ['title', 'loginblock'],
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
import router from 'vuejs/route'
|
import router from 'vuejs/route'
|
||||||
|
|
||||||
let basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;
|
let basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import Vue from 'vue'
|
||||||
|
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
|
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
import router from 'vuejs/route'
|
import router from 'vuejs/route'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
|
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
import router from 'vuejs/route'
|
import router from 'vuejs/route'
|
||||||
|
|
||||||
import FlagCollection from 'vuejs/components/User/FlagCollection'
|
import FlagCollection from 'vuejs/components/User/FlagCollection'
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
|
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
import router from 'vuejs/route'
|
import router from 'vuejs/route'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -301,8 +301,8 @@ import LinkedMaterialCard from 'vuejs/components/Content/LinkedMaterialCard'
|
||||||
|
|
||||||
import cardMixins from 'vuejs/components/cardMixins'
|
import cardMixins from 'vuejs/components/cardMixins'
|
||||||
|
|
||||||
import { REST } from 'vuejs/api/rest-axios'
|
import REST from 'vuejs/api/rest-axios'
|
||||||
import { MGQ } from 'vuejs/api/graphql-axios'
|
import MGQ from 'vuejs/api/graphql-axios'
|
||||||
import { print } from 'graphql/language/printer'
|
import { print } from 'graphql/language/printer'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import materiauFields from 'vuejs/api/gql/materiaumodal.fragment.gql'
|
import materiauFields from 'vuejs/api/gql/materiaumodal.fragment.gql'
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
import router from 'vuejs/route'
|
import router from 'vuejs/route'
|
||||||
|
|
||||||
let basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;
|
let basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "LoginForm",
|
name: "LoginForm",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
|
|
||||||
import passwordStrength from 'check-password-strength'
|
import passwordStrength from 'check-password-strength'
|
||||||
|
|
||||||
|
|
|
@ -118,9 +118,9 @@
|
||||||
import router from 'vuejs/route'
|
import router from 'vuejs/route'
|
||||||
import store from 'vuejs/store'
|
import store from 'vuejs/store'
|
||||||
|
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
import { REST } from 'vuejs/api/rest-axios'
|
import REST from 'vuejs/api/rest-axios'
|
||||||
import { MGQ } from 'vuejs/api/graphql-axios'
|
import MGQ from 'vuejs/api/graphql-axios'
|
||||||
import { print } from 'graphql/language/printer'
|
import { print } from 'graphql/language/printer'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
// import materiauFields from 'vuejs/api/gql/materiau.fragment.gql'
|
// import materiauFields from 'vuejs/api/gql/materiau.fragment.gql'
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
import router from 'vuejs/route'
|
import router from 'vuejs/route'
|
||||||
import store from 'vuejs/store'
|
import store from 'vuejs/store'
|
||||||
|
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
import { REST } from 'vuejs/api/rest-axios'
|
import REST from 'vuejs/api/rest-axios'
|
||||||
import { MGQ } from 'vuejs/api/graphql-axios'
|
import MGQ from 'vuejs/api/graphql-axios'
|
||||||
import { print } from 'graphql/language/printer'
|
import { print } from 'graphql/language/printer'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
// import materiauFields from 'vuejs/api/gql/materiau.fragment.gql'
|
// import materiauFields from 'vuejs/api/gql/materiau.fragment.gql'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// https://forum.vuejs.org/t/how-to-use-helper-functions-for-imported-modules-in-vuejs-vue-template/6266/5
|
// https://forum.vuejs.org/t/how-to-use-helper-functions-for-imported-modules-in-vuejs-vue-template/6266/5
|
||||||
|
|
||||||
import { REST } from 'vuejs/api/rest-axios'
|
import REST from 'vuejs/api/rest-axios'
|
||||||
import Modal from 'vuejs/components/Helper/Modal'
|
import Modal from 'vuejs/components/Helper/Modal'
|
||||||
import LoginRegister from 'vuejs/components/Helper/LoginRegister'
|
import LoginRegister from 'vuejs/components/Helper/LoginRegister'
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
|
|
@ -3,10 +3,10 @@ import Vuex from 'vuex'
|
||||||
|
|
||||||
import { createStore } from 'vuex-extensions'
|
import { createStore } from 'vuex-extensions'
|
||||||
|
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
// import qs from 'querystring-es3'
|
// import qs from 'querystring-es3'
|
||||||
|
|
||||||
import { MGQ } from 'vuejs/api/graphql-axios'
|
import MGQ from 'vuejs/api/graphql-axios'
|
||||||
import { print } from 'graphql/language/printer'
|
import { print } from 'graphql/language/printer'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
// import materiauFields from 'vuejs/api/gql/materiau.fragment.gql'
|
// import materiauFields from 'vuejs/api/gql/materiau.fragment.gql'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
import { REST } from 'vuejs/api/rest-axios'
|
import REST from 'vuejs/api/rest-axios'
|
||||||
// import { MA } from 'vuejs/api/ma-axios'
|
// import MA from 'vuejs/api/ma-axios'
|
||||||
// import qs from 'querystring-es3'
|
// import qs from 'querystring-es3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// import { REST } from 'vuejs/api/rest-axios'
|
// import REST from 'vuejs/api/rest-axios'
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
// import qs from 'querystring-es3'
|
// import qs from 'querystring-es3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { REST } from 'vuejs/api/rest-axios'
|
import REST from 'vuejs/api/rest-axios'
|
||||||
|
|
||||||
import { MGQ } from 'vuejs/api/graphql-axios'
|
import MGQ from 'vuejs/api/graphql-axios'
|
||||||
import { print } from 'graphql/language/printer'
|
import { print } from 'graphql/language/printer'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import productsGQL from 'vuejs/api/gql/products.fragment.gql'
|
import productsGQL from 'vuejs/api/gql/products.fragment.gql'
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// import { REST } from 'vuejs/api/rest-axios'
|
// import REST from 'vuejs/api/rest-axios'
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
import qs from 'querystring-es3'
|
import qs from 'querystring-es3'
|
||||||
|
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
import { MGQ } from 'vuejs/api/graphql-axios'
|
import MGQ from 'vuejs/api/graphql-axios'
|
||||||
import { print } from 'graphql/language/printer'
|
import { print } from 'graphql/language/printer'
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import searchresultGQL from 'vuejs/api/gql/searchresults.fragment.gql'
|
import searchresultGQL from 'vuejs/api/gql/searchresults.fragment.gql'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
import { REST } from 'vuejs/api/rest-axios'
|
import REST from 'vuejs/api/rest-axios'
|
||||||
// import { MA } from 'vuejs/api/ma-axios'
|
// import MA from 'vuejs/api/ma-axios'
|
||||||
// import qs from 'querystring-es3'
|
// import qs from 'querystring-es3'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { REST } from 'vuejs/api/rest-axios'
|
import REST from 'vuejs/api/rest-axios'
|
||||||
// import { JSONAPI } from 'vuejs/api/json-axios'
|
// import JSONAPI from 'vuejs/api/json-axios'
|
||||||
import { MA } from 'vuejs/api/ma-axios'
|
import MA from 'vuejs/api/ma-axios'
|
||||||
import qs from 'querystring-es3'
|
import qs from 'querystring-es3'
|
||||||
|
|
||||||
import materiauGQL from 'vuejs/api/gql/materiauflaglist.fragment.gql'
|
import materiauGQL from 'vuejs/api/gql/materiauflaglist.fragment.gql'
|
||||||
|
@ -46,7 +46,7 @@ export default {
|
||||||
// state.username = data.username;
|
// state.username = data.username;
|
||||||
state.mail = data.current_user.mail
|
state.mail = data.current_user.mail
|
||||||
state.csrf_token = data.csrf_token
|
state.csrf_token = data.csrf_token
|
||||||
state.isloggedin = true
|
// state.isloggedin = true
|
||||||
state.logout_token = data.logout_token
|
state.logout_token = data.logout_token
|
||||||
},
|
},
|
||||||
setLoginMessage (state, message) {
|
setLoginMessage (state, message) {
|
||||||
|
@ -64,6 +64,8 @@ export default {
|
||||||
setUser (state, data) {
|
setUser (state, data) {
|
||||||
state.mail = data.mail[0].value
|
state.mail = data.mail[0].value
|
||||||
state.uuid = data.uuid[0].value
|
state.uuid = data.uuid[0].value
|
||||||
|
// with session_limit, only here we are certain that the user is logged
|
||||||
|
state.isloggedin = true
|
||||||
},
|
},
|
||||||
setRoles (state, roles) {
|
setRoles (state, roles) {
|
||||||
console.log('User setRoles', roles)
|
console.log('User setRoles', roles)
|
||||||
|
@ -235,6 +237,7 @@ export default {
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
console.log('user REST getUser data', data)
|
console.log('user REST getUser data', data)
|
||||||
console.log('roles', data.roles)
|
console.log('roles', data.roles)
|
||||||
|
// with session_limit, only here we are certain that the user is logged
|
||||||
commit('setUser', data)
|
commit('setUser', data)
|
||||||
if (data.roles) {
|
if (data.roles) {
|
||||||
commit('setRoles', data.roles)
|
commit('setRoles', data.roles)
|
||||||
|
|
Loading…
Reference in New Issue