fix some linting errors

This commit is contained in:
catarak 2016-06-24 18:18:22 -04:00
parent e20b0545d1
commit e18a5e0941
5 changed files with 18 additions and 22 deletions

View file

@ -4,15 +4,13 @@ import { reduxForm } from 'redux-form';
import * as UserActions from '../actions'; import * as UserActions from '../actions';
import LoginForm from '../components/LoginForm'; import LoginForm from '../components/LoginForm';
class LoginView extends React.Component { function LoginView(props) {
render() { return (
return ( <div className="login">
<div className="login"> <h1>Login</h1>
<h1>Login</h1> <LoginForm {...props} />
<LoginForm {...this.props} /> </div>
</div> );
);
}
} }
function mapStateToProps(state) { function mapStateToProps(state) {

View file

@ -4,15 +4,13 @@ import * as UserActions from '../actions';
import { reduxForm } from 'redux-form'; import { reduxForm } from 'redux-form';
import SignupForm from '../components/SignupForm'; import SignupForm from '../components/SignupForm';
class SignupView extends React.Component { function SignupView(props) {
render() { return (
return ( <div className="signup">
<div className="signup"> <h1>Sign Up</h1>
<h1>Sign Up</h1> <SignupForm {...props} />
<SignupForm {...this.props} /> </div>
</div> );
);
}
} }
function mapStateToProps(state) { function mapStateToProps(state) {

View file

@ -86,4 +86,4 @@ passport.use(new LocalStrategy({ usernameField: 'email' }, (email, password, don
// }); // });
// }); // });
// } // }
// })); // }));

View file

@ -32,9 +32,10 @@ userSchema.pre('save', function (next) {
* Helper method for validating user's password. * Helper method for validating user's password.
*/ */
userSchema.methods.comparePassword = function (candidatePassword, cb) { userSchema.methods.comparePassword = function (candidatePassword, cb) {
// userSchema.methods.comparePassword = (candidatePassword, cb) => {
bcrypt.compare(candidatePassword, this.password, (err, isMatch) => { bcrypt.compare(candidatePassword, this.password, (err, isMatch) => {
cb(err, isMatch); cb(err, isMatch);
}); });
}; };
export default mongoose.model('User', userSchema); export default mongoose.model('User', userSchema);

View file

@ -58,8 +58,7 @@ app.use('/api', projects);
app.use('/', serverRoutes); app.use('/', serverRoutes);
// configure passport // configure passport
// const passportConfig = require('./config/passport'); const passportConfig = require('./config/passport');
require('./config/passport');
// Connect to MongoDB // Connect to MongoDB
// mongoose.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI); // mongoose.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI);