Skip to content

Commit 3266e42

Browse files
committed
minor
1 parent ad59fe3 commit 3266e42

File tree

9 files changed

+7
-55
lines changed

9 files changed

+7
-55
lines changed

extra

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/js/js-extra

extra/.gitkeep

Whitespace-only changes.

handlers/auth/router.js

-35
Original file line numberDiff line numberDiff line change
@@ -100,38 +100,3 @@ function addProviderRoute(providerName) {
100100

101101
// disconnect with existing profile
102102
router.post('/disconnect/:providerName', mustBeAuthenticated, disconnect.post);
103-
104-
/*
105-
router.get('/mail', function*(next) {
106-
require('lib/mailer').sendMail({
107-
from: 'iliakan@javascript.ru',
108-
109-
subject: 'hello',
110-
text: 'hello world!'
111-
}, function() {
112-
console.log(arguments);
113-
});
114-
this.body = "test";
115-
});
116-
*/
117-
118-
119-
/*if (err) return next(err);
120-
if (!user) { return res.redirect('/signin') }
121-
* res.redirect('/account');
122-
* }
123-
{ successRedirect: '/auth/popup-success', failureRedirect: '/auth/popup-failure' })*/
124-
125-
/*
126-
127-
router.get('/popup-success', function*() {
128-
this.body = this.render('popup-success');
129-
});
130-
131-
router.get('/popup-failure', function*() {
132-
var reason = this.session.messages ? this.session.messages[0] : '';
133-
delete this.session.messages;
134-
135-
this.body = this.render('popup-failure', { reason: reason });
136-
});
137-
*/

handlers/auth/strategies/localStrategy.js

-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ module.exports = new LocalStrategy({
1818

1919
co(function*() {
2020

21-
// @tyv UNCOMMENT SPINNER
22-
// yield function(callback) {};
23-
2421
if (!email) throw new UserAuthError('Укажите email.');
2522
if (!password) throw new UserAuthError('Укажите пароль.');
2623

handlers/newsletter/templates/subscriptions.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ block append variables
88

99
block content
1010

11-
p Вы хотели бы получать уведомления по темам:
11+
p Темы:
1212

1313
style.
1414
.main ul > li:before {

handlers/tutorial/models/article.js

+1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ schema.statics.findTree = function* (options) {
138138
addPrevNext();
139139

140140
return {
141+
articles: articlesById,
141142
children: root,
142143
byId: function(id) {
143144
if (!id) return undefined;

handlers/users/models/user.js

+2
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ UserSchema.methods.getProfileUrl = function() {
220220

221221
UserSchema.methods.checkPassword = function(password) {
222222
if (!password) return false; // empty password means no login by password
223+
if (!this.passwordHash) return false; // this user does not have password (the line below would hang!)
224+
223225
return hash.createHashSlow(password, this.salt) == this.passwordHash;
224226
};
225227

modules/app.js

-15
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ app.requireHandler('requestLog');
3939

4040
app.requireHandler('nocache');
4141

42-
/*
43-
app.id = Math.random();
44-
app.use(function*(next) {
45-
console.log(app.id);
46-
yield next;
47-
});
48-
*/
49-
5042
//app.requireHandler('time');
5143

5244
// this middleware adds this.render method
@@ -92,13 +84,6 @@ app.requireHandler('flash');
9284

9385
app.requireHandler('paymentsMethods');
9486

95-
//app.requireHandler('sendMail');
96-
97-
// right before endpoints
98-
// so that the error won't fall through the handlers above
99-
// all above ^^^ handlers can finish processing the usual way
100-
//app.requireHandler('throwFinish');
101-
10287
// ======== Endpoint services that actually generate something ==========
10388

10489
var endpoints = [];

modules/config/webpack.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ var webpackConfig = {
159159
};
160160

161161

162-
if (process.env.NODE_ENV != 'development') { // production, ebook
162+
//if (process.env.NODE_ENV != 'development') { // production, ebook
163+
if (process.env.NODE_ENV == 'production') { // production, ebook
163164
webpackConfig.plugins.push(
164165
function clearBeforeRun() {
165166
function clear(compiler, callback) {

0 commit comments

Comments
 (0)