@ -19,7 +19,6 @@ var privileges = require('../privileges');
var sockets = require ( '../socket.io' ) ;
var authenticationController = module . exports ;
var apiController = require ( './api' ) ;
authenticationController . register = function ( req , res ) {
var registrationType = meta . config . registrationType || 'normal' ;
@ -286,10 +285,10 @@ function continueLogin(req, res, next) {
} else {
delete req . query . lang ;
async . parallel ( {
async . series ( {
doLogin : async . apply ( authenticationController . doLogin , req , userData . uid ) ,
buildHeader : async . apply ( middleware . buildHeader , req , res ) ,
header : async . apply ( middleware . generateHeader , req , res , { } ) ,
config : async . apply ( apiController . loadConfig , req ) ,
} , function ( err , payload ) {
if ( err ) {
return helpers . noScriptErrors ( req , res , err . message , 403 ) ;
@ -309,7 +308,7 @@ function continueLogin(req, res, next) {
res . status ( 200 ) . send ( {
next : destination ,
header : payload . header ,
config : payload . config ,
config : res. locals . config ,
} ) ;
}
} ) ;
@ -473,7 +472,7 @@ authenticationController.logout = function (req, res, next) {
function ( next ) {
req . logout ( ) ;
req . session . regenerate ( function ( err ) {
req . uid = 0 ;
delete req . uid ;
next ( err ) ;
} ) ;
} ,
@ -490,9 +489,9 @@ authenticationController.logout = function (req, res, next) {
if ( req . body . noscript === 'true' ) {
res . redirect ( nconf . get ( 'relative_path' ) + '/' ) ;
} else {
async . parallel ( {
async . series ( {
buildHeader : async . apply ( middleware . buildHeader , req , res ) ,
header : async . apply ( middleware . generateHeader , req , res , { } ) ,
config : async . apply ( apiController . loadConfig , req ) ,
} , function ( err , payload ) {
if ( err ) {
return res . status ( 500 ) ;
@ -500,7 +499,7 @@ authenticationController.logout = function (req, res, next) {
res . status ( 200 ) . send ( {
header : payload . header ,
config : payload . config ,
config : res. locals . config ,
} ) ;
} ) ;
}