File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,7 +212,6 @@ function handleRequest (req, res) {
212212 let connection = req . connection || { }
213213 req . params . ip = headers [ 'x-forwarded-for' ] || connection . remoteAddress
214214 req . once ( 'error' , ( err ) => sendErr ( res , err ) )
215- let jwt = ( headers . authorization || '' ) . replace ( / ^ B e a r e r \s / , '' )
216215 let callHandler = ( ) => {
217216 if ( ! hasBody [ action ] ) return actionHandler ( req , res , name , action )
218217 return bodyParse ( req ) . then ( ( body ) => {
@@ -222,6 +221,7 @@ function handleRequest (req, res) {
222221 }
223222 let noAuth = ! jwtOpts || ( resource . skipAuth && resource . skipAuth [ action ] )
224223 if ( noAuth ) return callHandler ( )
224+ let jwt = ( headers . authorization || '' ) . replace ( / ^ B e a r e r \s / , '' )
225225 authenticate ( jwt ) . then ( ( authData ) => {
226226 req . auth = req . params . auth = authTrans ? authTrans ( authData ) : authData
227227 return callHandler ( )
You can’t perform that action at this time.
0 commit comments