Skip to content

Commit

Permalink
BC-5142 - BrB registrationlinks lead to 504 Gateway Time-out (#3355)
Browse files Browse the repository at this point in the history
* Redirect correctly for invalid import hash
  • Loading branch information
MartinSchuhmacher authored Dec 1, 2023
1 parent a703cf1 commit 00269ab
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
6 changes: 5 additions & 1 deletion controllers/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ const getSchoolConsentVersionByType = async (req, res, consentType) => {
}
} catch (error) {
// invalid token
throw new Error('Invalid import hash!');
logger.warn(
'Invalid import hash!',
formatError(error),
);
return Promise.resolve();
}
return undefined;
};
Expand Down
1 change: 1 addition & 0 deletions static/scripts/dataprivacy/registration-link-validation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions static/scripts/dataprivacy/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ const USER_LANG_SET_KEY = 'USER_LANG_SET';
window.addEventListener('DOMContentLoaded', () => {
// show language settings if not set
if (getCookie(USER_LANG_SET_KEY) === 'true') {
document.querySelector('#language-screen').style.display = 'none';
document.querySelector('#welcome-screen').style.display = 'block';
if (document.querySelector('#language-screen')) {
document.querySelector('#language-screen').style.display = 'none';
}
if (document.querySelector('#welcome-screen')) {
document.querySelector('#welcome-screen').style.display = 'block';
}
} else {
document.querySelector('#language-screen').style.display = 'block';
document.querySelector('#welcome-screen').style.display = 'none';
if (document.querySelector('#language-screen')) {
document.querySelector('#language-screen').style.display = 'block';
}
if (document.querySelector('#welcome-screen')) {
document.querySelector('#welcome-screen').style.display = 'none';
}
$('select').trigger('chosen:updated');
}

Expand Down

0 comments on commit 00269ab

Please sign in to comment.