File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,7 @@ module.exports = (app) => {
110110 app . get ( encodeURI ( `${ context } /webhook/` ) , ( req , res ) => {
111111 const { verifyToken } = paramsConfig ;
112112
113- const mode = req . query [ 'hub.mode ' ] ;
114- const token = req . query [ 'hub.verify_token' ] ;
115- const challenge = req . query [ 'hub.challenge' ] ;
116-
117- if ( mode === 'subscribe' && token === verifyToken ) {
113+ if ( req . query [ 'hub.verify_token' ] === verifyToken ) {
118114 setTimeout ( ( ) => {
119115 functions
120116 . doSubscribeRequest ( )
@@ -123,7 +119,7 @@ module.exports = (app) => {
123119 prefix : '[subscribe] RESPONSE' ,
124120 message : `Subscription result: ${ response . success } `
125121 } ) ;
126- res . status ( 200 ) . send ( challenge ) ;
122+ res . status ( 200 ) . send ( req . query [ 'hub. challenge' ] ) ;
127123 } )
128124 . catch ( ( error ) => {
129125 signale . error ( {
You can’t perform that action at this time.
0 commit comments