Skip to content

Commit 793ef2b

Browse files
author
Joel Taylor
committed
Merge pull request #293 from codeschool/remove_fivejs_feed
Remove fivejs feed
2 parents 4ba8b0c + be7b028 commit 793ef2b

File tree

3 files changed

+0
-62
lines changed

3 files changed

+0
-62
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;

server/views/news/index.jade

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,6 @@ block content
8484
a.btn.btn--a--bordered.db.dib--s.mbs.mrs--s(href='https://itunes.apple.com/us/podcast/5-minutes-of-javascript/id775261328') Listen Now
8585
a.btn.btn--a--bordered.db.dib--s(href='https://fivejs.codeschool.com/') Visit Site
8686

87-
.pillar.pillar--l.pillar--thick.mbl
88-
89-
ul.list.list--l.list--divided.list--divided--l
90-
91-
- for story in news_collection
92-
li.list-item
93-
article
94-
h2.h.h--4
95-
a.externalLink.tct.twb(href=story.url target='_blank')
96-
= story.title
97-
- iconPartial = { name: 'external', className: 'externalLink-icon', size: 14 }
98-
include /views/partials/_icon
99-
p.mbf.tss.
100-
#{story.body}
101-
10287
h3.h.h--4.mbs The Latest News in Your Inbox
10388

10489
p.tcs.tss Subscribe now to the weekly 5 Minutes of JavaScript newsletter.

0 commit comments

Comments
 (0)