Skip to content

Commit

Permalink
fixed token not being correctly passed from get_token to the feedback…
Browse files Browse the repository at this point in the history
… function
  • Loading branch information
CommanderStorm committed Dec 26, 2022
1 parent e97a13f commit 5e2f141
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions webclient/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export const configRelease = {

export const configLocal = {
app_prefix: "",
cdn_prefix: "/cdn/",
api_prefix: "http://localhost:8080/api/",
cdn_prefix: "https://nav.tum.de/cdn/",
api_prefix: "https://nav.tum.de/api/",
};
5 changes: 4 additions & 1 deletion webclient/src/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ window.feedback = (() => {
if (r.status === 201) {
token = {
creation: Date.now(),
value: JSON.parse(r.response).token,
value: r.response.replace(/^"(.*)"$/, '$1'),
};
if (navigatum)
navigatum.setLocalStorageWithExpiry("feedback-token", token, 6);
Expand Down Expand Up @@ -170,6 +170,9 @@ window.feedback = (() => {
const invalidTokenError = "${{_.feedback.error.send_invalid_token}}$";
_showError(`${invalidTokenError} (${r.responseText})`, false);
} else {
// we reset the token here to be sure that it is the cause of the error
localStorage.removeItem("feedback-token");
token = null;
const unexpectedStatusError =
"${{_.feedback.error.send_unexpected_status}}$";
_showError(`${unexpectedStatusError}${r.status}`, false);
Expand Down

0 comments on commit 5e2f141

Please sign in to comment.