Merge pull request #2869 from ErisDS/issue-2779

Ember redirect to signup
This commit is contained in:
Hannah Wolfe 2014-06-04 15:06:10 +01:00
commit 684ff082ab
2 changed files with 10 additions and 1 deletions

View File

@ -180,6 +180,15 @@ function redirectToSignup(req, res, next) {
api.users.doesUserExist().then(function (exists) {
if (!exists) {
// TODO remove this when ember admin becomes the default
if (req.path.match(/\/ember\//)) {
if (!req.path.match(/\/ghost\/ember\/signup\//)) {
return res.redirect(config().paths.subdir + '/ghost/ember/signup/');
} else {
return next();
}
}
// END remove this
return res.redirect(config().paths.subdir + '/ghost/signup/');
}
next();

View File

@ -10,7 +10,7 @@ var admin = require('../controllers/admin'),
adminRoutes = function (server) {
// Have ember route look for hits first
// to prevent conflicts with pre-existing routes
server.get('/ghost/ember/*', admin.index);
server.get('/ghost/ember/*', middleware.redirectToSignup, admin.index);
var subdir = config().paths.subdir;
// ### Admin routes