mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Merge pull request #2869 from ErisDS/issue-2779
Ember redirect to signup
This commit is contained in:
commit
684ff082ab
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user