|
|
@ -33,6 +33,7 @@ export function createAuthStore() { |
|
|
user: $store.user, |
|
|
user: $store.user, |
|
|
tenantId: $store.tenantId, |
|
|
tenantId: $store.tenantId, |
|
|
tenantSet: $store.tenantSet, |
|
|
tenantSet: $store.tenantSet, |
|
|
|
|
|
initTemplate: $store.initTemplate, |
|
|
loaded: $store.loaded, |
|
|
loaded: $store.loaded, |
|
|
initials, |
|
|
initials, |
|
|
isAdmin, |
|
|
isAdmin, |
|
|
@ -80,8 +81,16 @@ export function createAuthStore() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function updateInitTemplate(template) { |
|
|
|
|
|
auth.update(store => { |
|
|
|
|
|
store.initTemplate = template |
|
|
|
|
|
return store |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
subscribe: store.subscribe, |
|
|
subscribe: store.subscribe, |
|
|
|
|
|
resetInitTemplate: () => updateInitTemplate(null), |
|
|
setOrganisation: setOrganisation, |
|
|
setOrganisation: setOrganisation, |
|
|
checkQueryString: async () => { |
|
|
checkQueryString: async () => { |
|
|
const urlParams = new URLSearchParams(window.location.search) |
|
|
const urlParams = new URLSearchParams(window.location.search) |
|
|
@ -89,6 +98,11 @@ export function createAuthStore() { |
|
|
const tenantId = urlParams.get("tenantId") |
|
|
const tenantId = urlParams.get("tenantId") |
|
|
await setOrganisation(tenantId) |
|
|
await setOrganisation(tenantId) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// set the template to create an app from
|
|
|
|
|
|
if (urlParams.has("template")) { |
|
|
|
|
|
updateInitTemplate(urlParams.get("template")) |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
setOrg: async tenantId => { |
|
|
setOrg: async tenantId => { |
|
|
await setOrganisation(tenantId) |
|
|
await setOrganisation(tenantId) |
|
|
|