mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Merge pull request #2869 from ErisDS/issue-2779
Ember redirect to signup
This commit is contained in:
commit
684ff082ab
2 changed files with 10 additions and 1 deletions
|
@ -180,6 +180,15 @@ function redirectToSignup(req, res, next) {
|
||||||
|
|
||||||
api.users.doesUserExist().then(function (exists) {
|
api.users.doesUserExist().then(function (exists) {
|
||||||
if (!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/');
|
return res.redirect(config().paths.subdir + '/ghost/signup/');
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
|
|
|
@ -10,7 +10,7 @@ var admin = require('../controllers/admin'),
|
||||||
adminRoutes = function (server) {
|
adminRoutes = function (server) {
|
||||||
// Have ember route look for hits first
|
// Have ember route look for hits first
|
||||||
// to prevent conflicts with pre-existing routes
|
// 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;
|
var subdir = config().paths.subdir;
|
||||||
// ### Admin routes
|
// ### Admin routes
|
||||||
|
|
Loading…
Add table
Reference in a new issue