mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
fixes login/register and auth routes in relative path install
This commit is contained in:
@@ -23,7 +23,7 @@ var socket,
|
||||
} else {
|
||||
var max_reconnection_attemps = 5;
|
||||
var reconnection_delay = 200;
|
||||
socket = io.connect(RELATIVE_PATH, {
|
||||
socket = io.connect('', {
|
||||
'max reconnection attempts': max_reconnection_attemps,
|
||||
'reconnection delay': reconnection_delay
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ var nconf = require('nconf'),
|
||||
Admin.isAdmin = function (req, res, next) {
|
||||
user.isAdministrator((req.user && req.user.uid) ? req.user.uid : 0, function (err, isAdmin) {
|
||||
if (!isAdmin) {
|
||||
res.redirect('/403');
|
||||
res.redirect(403, '/403');
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ var path = require('path'),
|
||||
|
||||
(function (Api) {
|
||||
Api.createRoutes = function (app) {
|
||||
|
||||
app.namespace('/api', function () {
|
||||
app.get('/get_templates_listing', function (req, res) {
|
||||
utils.walk(path.join(__dirname, '../../', 'public/templates'), function (err, data) {
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
}
|
||||
|
||||
Auth.createRoutes = function(app) {
|
||||
app.namespace(nconf.get('relative_path'), function () {
|
||||
app.post('/logout', function(req, res) {
|
||||
if (req.user && req.user.uid > 0) {
|
||||
winston.info('[Auth] Session ' + req.sessionID + ' logout (uid: ' + req.user.uid + ')');
|
||||
@@ -214,5 +215,6 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}(exports));
|
||||
Reference in New Issue
Block a user