Skip to content

Commit be7b028

Browse files
author
joeltaylor
committed
Remove unused fivesjs logic
1 parent 5f3c435 commit be7b028

File tree

2 files changed

+0
-47
lines changed

2 files changed

+0
-47
lines changed

server/routes/news.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,6 @@ function ensureAuthenticated(req, res, next) {
6363
}
6464
/* End GitHub Auth */
6565

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-
8966
function buildComment(request, response, next){
9067

9168
var newComment = request.body;
@@ -257,19 +234,6 @@ router.
257234
});
258235
}).
259236

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-
273237
post('/', cookieParser, ensureAuthenticated, parseForm, expressValidator(), csrfProtection, function(req, res) {
274238

275239
// Validations

server/services/articles.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ var Articles = {
6464
db.query('UPDATE articles SET approved = false WHERE id = $1;', [id], cb)
6565
},
6666

67-
// Creates a new News story pre-approved.
68-
createNews(newStory, cb) {
69-
var slug = slugGenerator.createSlug(newStory.title);
70-
71-
db.query(
72-
"INSERT INTO articles (title, slug, body, url, published_at, news, approved) VALUES ($1, $2, $3, $4, now(), true, true);",
73-
[newStory.title, slug, newStory.summary, newStory.url],
74-
cb
75-
)
76-
},
77-
7867
// Creates a new Flow article
7968
createFlow(newFlow, cb) {
8069
var title = newFlow.title;

0 commit comments

Comments
 (0)