@@ -63,29 +63,6 @@ function ensureAuthenticated(req, res, next) {
63
63
}
64
64
/* End GitHub Auth */
65
65
66
- /* Basic Auth*/
67
- var BasicStrategy = require ( 'passport-http' ) . BasicStrategy ;
68
- // Use the BasicStrategy within Passport.
69
- // Strategies in Passport require a `verify` function, which accept
70
- // credentials (in this case, a username and password), and invoke a callback
71
- // with a user object.
72
- passport . use ( new BasicStrategy ( {
73
- } ,
74
- function ( username , password , done ) {
75
- // asynchronous verification, for effect...
76
- process . nextTick ( function ( ) {
77
-
78
- // Check for username. If there is no username given or the password is
79
- // incorrect, set the user to 'false' to indicate failure. Otherwise,
80
- // return the authenticated 'user'.
81
- if ( ! username || username != process . env . BASICAUTH_USERNAME ) { return done ( null , false ) ; }
82
- if ( password != process . env . BASICAUTH_PASSWORD ) { return done ( null , false ) ; }
83
- return done ( null , username ) ;
84
- } ) ;
85
- }
86
- ) ) ;
87
- /* End Basic Auth*/
88
-
89
66
function buildComment ( request , response , next ) {
90
67
91
68
var newComment = request . body ;
@@ -257,19 +234,6 @@ router.
257
234
} ) ;
258
235
} ) .
259
236
260
- post ( '/update' , passport . authenticate ( 'basic' , { session : false } ) , parseJson , function ( req , res ) {
261
- var stories = req . body ;
262
- for ( i = 0 ; i < stories . length ; i ++ ) {
263
- var story = stories [ i ] ;
264
- // I'm sure there's a better way to do this.
265
- if ( i === stories . length - 1 ) {
266
- Articles . createNews ( story , function ( ) { res . sendStatus ( 201 ) ; } ) ;
267
- } else {
268
- Articles . createNews ( story , function ( ) { } ) ;
269
- }
270
- }
271
- } ) .
272
-
273
237
post ( '/' , cookieParser , ensureAuthenticated , parseForm , expressValidator ( ) , csrfProtection , function ( req , res ) {
274
238
275
239
// Validations
0 commit comments