From f26a250b0198d1e232e6863d700771eaf07f37d5 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 6 Jun 2014 18:05:26 +0700 Subject: [PATCH 1/3] Add relative_path to authentication redirects --- src/routes/authentication.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index 7c28602860..39b0a7f51a 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -150,8 +150,8 @@ })); app.get(strategy.callbackURL, passport.authenticate(strategy.name, { - successRedirect: '/', - failureRedirect: '/login' + successRedirect: nconf.get('relative_path) + '/', + failureRedirect: nconf.get('relative_path') + '/login' })); } } From ce083573a9d9b09984068ac480953f7180b20884 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 6 Jun 2014 18:06:42 +0700 Subject: [PATCH 2/3] Fix typo --- src/routes/authentication.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index 39b0a7f51a..c22134d176 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -150,7 +150,7 @@ })); app.get(strategy.callbackURL, passport.authenticate(strategy.name, { - successRedirect: nconf.get('relative_path) + '/', + successRedirect: nconf.get('relative_path') + '/', failureRedirect: nconf.get('relative_path') + '/login' })); } From 5f1b1ad2bf4e58f437be1f4540052fc3ac98b84d Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 6 Jun 2014 18:36:02 +0700 Subject: [PATCH 3/3] Also add relative_path to destination Because the destination url does not include the relative_path --- src/routes/authentication.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/authentication.js b/src/routes/authentication.js index c22134d176..85461a346c 100644 --- a/src/routes/authentication.js +++ b/src/routes/authentication.js @@ -110,8 +110,8 @@ require('../socket.io').emitUserCount(); plugins.fireHook('filter:register.complete', uid, req.body.referrer, function(err, uid, destination) { - if(destination) { - res.redirect(destination); + if (destination) { + res.redirect(nconf.get('relative_path') + destination); } else { res.redirect(nconf.get('relative_path') + '/'); }