@@ -21,7 +21,7 @@ app.use(bodyParser.urlencoded({extended: true}))
2121// mount grant
2222app . use ( grant )
2323
24- app . get ( '/connect_facebook_post' , function ( req , res ) {
24+ app . get ( '/connect_facebook_post' , ( req , res ) => {
2525 var url = grant . config . facebook . protocol + '://' +
2626 grant . config . facebook . host + '/connect/facebook'
2727 request . post ( url , {
@@ -30,30 +30,30 @@ app.get('/connect_facebook_post', function (req, res) {
3030 state : ( Math . floor ( Math . random ( ) * 999999 ) + 1 )
3131 } ,
3232 followRedirect : false
33- } , function ( err , _res , body ) {
33+ } , ( err , _res , body ) => {
3434 res . set ( 'set-cookie' , _res . headers [ 'set-cookie' ] [ 0 ] )
3535 res . redirect ( _res . headers . location )
3636 } )
3737} )
3838
39- app . get ( '/connect_facebook_get' , function ( req , res ) {
39+ app . get ( '/connect_facebook_get' , ( req , res ) => {
4040 // generate 6 digit random state number on each authorization attempt
4141 var state = ( Math . floor ( Math . random ( ) * 999999 ) + 1 )
4242
4343 res . redirect ( '/connect/facebook?state=' + state )
4444} )
4545
46- app . get ( '/handle_facebook_callback' , function ( req , res ) {
46+ app . get ( '/handle_facebook_callback' , ( req , res ) => {
4747 console . log ( 'The state was' , req . session . grant . state )
4848 console . log ( req . query )
4949 res . end ( JSON . stringify ( req . query , null , 2 ) )
5050} )
5151
52- app . get ( '/form' , function ( req , res ) {
52+ app . get ( '/form' , ( req , res ) => {
5353 res . writeHead ( 200 , { 'content-type' : 'text/html' } )
5454 res . end ( fs . readFileSync ( './form.html' , 'utf8' ) )
5555} )
5656
57- app . listen ( 3000 , function ( ) {
57+ app . listen ( 3000 , ( ) => {
5858 console . log ( 'Express server listening on port ' + 3000 )
5959} )
0 commit comments