From dfbaed45ce9caa3d57fec5df6be88a45761e272c Mon Sep 17 00:00:00 2001 From: AndreiaPena Date: Wed, 4 Dec 2024 18:49:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20mon-pix:=20remove=20lang=20param?= =?UTF-8?q?eter=20from=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-pix/app/components/download-session-results.gjs | 2 +- .../integration/components/download-session-results-test.gjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mon-pix/app/components/download-session-results.gjs b/mon-pix/app/components/download-session-results.gjs index 1e727722038..e60eaf8535f 100644 --- a/mon-pix/app/components/download-session-results.gjs +++ b/mon-pix/app/components/download-session-results.gjs @@ -20,7 +20,7 @@ export default class DownloadSessionResults extends Component { this.showErrorMessage = false; try { - const token = decodeURIComponent(PixWindow.getLocationHash().slice(1)); + const token = decodeURIComponent(PixWindow.getLocationHash().slice(1, -8)); await this.fileSaver.save({ url: `${ENV.APP.API_HOST}/api/sessions/download-all-results`, options: { diff --git a/mon-pix/tests/integration/components/download-session-results-test.gjs b/mon-pix/tests/integration/components/download-session-results-test.gjs index a5d7800eb43..a93864012a0 100644 --- a/mon-pix/tests/integration/components/download-session-results-test.gjs +++ b/mon-pix/tests/integration/components/download-session-results-test.gjs @@ -51,7 +51,7 @@ module('Integration | Component | download-session-results', function (hooks) { // given fileSaver.save.resolves(); const tokenHash = 'mytoken'; - sinon.stub(PixWindow, 'getLocationHash').returns(`#${tokenHash}`); + sinon.stub(PixWindow, 'getLocationHash').returns(`#${tokenHash}?lang=fr`); // when const screen = await render(hbs``);