Adding helper for auth key resolution
This commit is contained in:
parent
902189c34d
commit
e4f4766f5f
@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { getAuthKeyFromProperties } from '../helpers/index'
|
||||
|
||||
import * as d3 from "d3";
|
||||
import * as align from "d3-sankey";
|
||||
@ -34,20 +35,15 @@ function fetchData() {
|
||||
//clear errors
|
||||
errorMessage.value = null;
|
||||
|
||||
var authKey;
|
||||
|
||||
if (props.sessionIdentifier.length > 0) {
|
||||
authKey = props.sessionIdentifier;
|
||||
} else if (props.username.length > 0) {
|
||||
authKey = props.username;
|
||||
} else {
|
||||
errorMessage.value =
|
||||
"_sessionIdentifier or username must be passed as query params.";
|
||||
try {
|
||||
var authKey = getAuthKeyFromProperties(props);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
errorMessage.value = error;
|
||||
return;
|
||||
}
|
||||
if (authKey) {
|
||||
fetch(
|
||||
`${import.meta.env.VITE_EO_SERVICES_URL}/api/interactions-flow?filter=${
|
||||
multiSelected.value
|
||||
`${import.meta.env.VITE_EO_SERVICES_URL}/api/interactions-flow?filter=${multiSelected.value
|
||||
}&authKey=${authKey}`,
|
||||
{
|
||||
credentials: "include", // fetch won't send cookies unless you set credentials
|
||||
@ -65,11 +61,10 @@ function fetchData() {
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
console.error(error);
|
||||
errorMessage.value = error;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function generateSankey(data) {
|
||||
// filter data
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { getAuthKeyFromProperties } from '../helpers/index'
|
||||
|
||||
import ContactTable from "../components/ContactTable.vue";
|
||||
import ContactsSummary from "../components/ContactsSummary.vue";
|
||||
@ -23,16 +24,8 @@ function fetchData() {
|
||||
errorMessage.value = null;
|
||||
contactData.value = null;
|
||||
|
||||
var authKey;
|
||||
var authKey = getAuthKeyFromProperties(props);
|
||||
|
||||
if (props.sessionIdentifier.length > 0) {
|
||||
authKey = props.sessionIdentifier;
|
||||
} else if (props.username.length > 0) {
|
||||
authKey = props.username;
|
||||
} else {
|
||||
errorMessage.value =
|
||||
"_sessionIdentifier or username must be passed as query params.";
|
||||
}
|
||||
if (authKey) {
|
||||
fetch(
|
||||
`${
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user