Skip to content

Commit 38676d5

Browse files
authored
Graceful failure for invalid auth (#1372)
* Rather than just a 404 page... redirect to login page and denote with QSP when data present * Some compliance with STYLEGUIDE.md max line length Applies to #1369 and #37 Auto-merge
1 parent ca90341 commit 38676d5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

controllers/auth.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ exports.auth = function (aReq, aRes, aNext) {
7777
var authenticate = null;
7878

7979
// Just in case someone tries a bad /auth/* url
80+
// or an auth has been EOL'd
8081
if (!strategyInstances[strategy]) {
81-
aNext();
82+
aRes.redirect('/login?invalidauth');
8283
return;
8384
}
8485

controllers/user.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,10 @@ exports.userEditPreferencesPage = function (aReq, aRes, aNext) {
890890
return aStrategy.display;
891891
});
892892

893-
options.defaultStrategy = strategies[defaultStrategy] ? strategies[defaultStrategy].name : null;
893+
options.defaultStrategy = strategies[defaultStrategy]
894+
? strategies[defaultStrategy].name
895+
: null;
896+
894897
options.defaultStrat = defaultStrategy;
895898
options.haveOtherStrategies = options.usedStrategies.length > 0;
896899

0 commit comments

Comments
 (0)