Skip to content

Commit ae2376c

Browse files
author
Curtis Lacy
committed
Added a top-level catch for exceptions, and switched the IMAP callback to use POST.
1 parent b264cda commit ae2376c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// Node 0.10.x adds additional cert checking, which could cause problems here.
22
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
33

4+
// Catch any and all exceptions.
5+
process.on( 'uncaughtException' ,function(err) {
6+
console.log( "Uncaught error", err );
7+
});
8+
49
var express = require('express'),
510
passport = require( 'passport' ),
611
FacebookStrategy = require( 'passport-facebook' ).Strategy,
@@ -204,7 +209,7 @@ app.get( '/auth/twitter/callback',
204209
}
205210
);
206211

207-
app.get( '/auth/imap/callback',
212+
app.post( '/auth/imap/callback',
208213
passport.authenticate( 'imap', { failureRedirect: '#auth-failure' } ),
209214
function( req, res ) {
210215
if( req.session[ 'auth-return' ] )

0 commit comments

Comments
 (0)