File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ const passportAuthenticateAsync = function (req, res) {
3737
3838Middleware . requireUser = async function ( req , res , next ) {
3939 var writeApi = require . main . require ( 'nodebb-plugin-write-api' ) ;
40- var token = ( writeApi . settings [ 'jwt:payloadKey' ] ? ( req . query [ writeApi . settings [ 'jwt:payloadKey' ] ] || req . body [ writeApi . settings [ 'jwt:payloadKey' ] ] ) : null ) || req . query . token || req . body . token ;
40+ const query = req . query || { } ;
41+ const body = req . body || { } ;
42+ var token = ( writeApi . settings [ 'jwt:payloadKey' ] ? ( query [ writeApi . settings [ 'jwt:payloadKey' ] ] || body [ writeApi . settings [ 'jwt:payloadKey' ] ] ) : null ) || query . token || body . token ;
4143 const loginAsync = util . promisify ( req . login ) . bind ( req ) ;
4244 var routeMatch ;
4345
You can’t perform that action at this time.
0 commit comments