Skip to content

Commit e660eb0

Browse files
Fix bug in updating token
1 parent c3bc6ae commit e660eb0

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

viplab-standalone-frontend-vue/src/pages/teacher/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,7 @@ export default {
26292629
let file = JSON.stringify(this.computationTemplate);
26302630
let dataBase64url = base64url(Buffer.from(file).toString());
26312631
2632-
//baseUrl = "http://localhost:3000/";
2632+
baseUrl = "http://localhost:3000/";
26332633
fetch(baseUrl + "sign", {
26342634
method: 'POST',
26352635
body: dataBase64url
@@ -2651,9 +2651,9 @@ export default {
26512651
this.$store.commit("updateDataTemplate", dataBase64url);
26522652
26532653
// authenticate with new token
2654-
this.ws = new WebSocket(this.$config.WEBSOCKET_API);
2654+
/*this.ws = new WebSocket(this.$config.WEBSOCKET_API);
26552655
let message = JSON.stringify({ type: "authenticate", content: { jwt: token } });
2656-
this.sendWaiting(message)
2656+
this.sendWaiting(message)*/
26572657
26582658
// preview ct in iFrame
26592659
let iFrameDiv = document.getElementById("iframe-div")

viplab-standalone-frontend-vue/src/pages/viplab/App.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
fill
277277
>
278278
<b-tabs card class="files" content-class="m-2" lazy>
279+
<!-- TODO: Filename verwenden -->
279280
<b-tab
280281
:title="'OutputFile ' + artifactParent_index"
281282
ref="artifact"
@@ -697,7 +698,7 @@ export default {
697698
if (data && (data === "{{ data }}" || data === "") || this.modifiedByTeacher) {
698699
this.json = this.$store.state.jsonTemplate;
699700
this.dataTemplate = this.$store.state.dataTemplate;
700-
this.$store.commit("updateModifiedByTeacher", false);
701+
701702
} else {
702703
this.json = JSON.parse(base64url.decode(data));
703704
this.$store.commit("updateDataTemplate", data);
@@ -710,15 +711,18 @@ export default {
710711
if (token && token !== "{{ token }}" && token !== "" && this.$store.state.token.length === 0) {
711712
this.$store.commit("updateToken", appDiv.getAttribute("data-token"));
712713
} else if (this.$store.state.token.length > 0) {
713-
if (token && (token === "{{ token }}" || token === "")) {
714+
if (token && (token === "{{ token }}" || token === "") || this.modifiedByTeacher) {
714715
this.token = this.$store.state.token;
716+
715717
} else {
716718
this.$store.commit("updateToken", appDiv.getAttribute("data-token"));
717719
}
718720
} else {
719721
this.token = "";
720722
}
721723
724+
this.$store.commit("updateModifiedByTeacher", false);
725+
722726
if (this.$store.state.dataTemplate.length === 0 && data !== "{{ data }}") {
723727
this.dataTemplate = data;
724728
} else if (this.$store.state.dataTemplate.length === 0 && Object.keys(this.$store.state.jsonTemplate).length > 0) {

0 commit comments

Comments
 (0)