start to add mailgun and nodemailer

This commit is contained in:
Cassie Tarakajian 2016-10-12 12:02:46 -04:00
parent 93de8596f2
commit 1610b0168d
7 changed files with 41 additions and 0 deletions

View file

@ -18,6 +18,9 @@ class LoginView extends React.Component {
<LoginForm {...this.props} />
{/* <h2 className="login__divider">Or</h2>
<GithubButton buttonText="Login with Github" /> */}
<Link className="form__signup-button" to="/signup">Signup</Link>
Or
<Link className="form__reset-password-button" to="/reset-password">Reset your password</Link>
<Link className="form__cancel-button" to="/">Cancel</Link>
</div>
);

View file

@ -0,0 +1,20 @@
import React from 'react';
import { Link } from 'react-router';
class ResetPasswordView extends React.Component {
componentDidMount() {
this.refs.forgotPassword.focus();
}
render() {
return (
<div className="forgot-password" ref="forgotPassword" tabIndex="0">
<h1>Forgot Password</h1>
<Link className="form__login-button" to="/login">Login</Link>
or
<Link className="form__signup-button" to="/signup">Sign up</Link>
<Link className="form__cancel-button" to="/">Cancel</Link>
</div>
);
}
}

View file

@ -29,6 +29,7 @@ import SketchList from '../components/SketchList';
import About from '../components/About';
import LoginView from '../components/LoginView';
import SignupView from '../components/SignupView';
import ResetPasswordView from '../components/ResetPasswordView';
class IDEView extends React.Component {
constructor(props) {
@ -410,6 +411,15 @@ class IDEView extends React.Component {
);
}
})()}
{(() => { // eslint-disable-line
if (this.props.location.pathname === '/reset-password') {
return (
<Overlay>
<ResetPasswordView />
</Overlay>
);
}
})()}
</div>
);

View file

@ -16,6 +16,7 @@ const routes = (store) =>
<IndexRoute component={IDEView} onEnter={checkAuth(store)} />
<Route path="/login" component={IDEView} />
<Route path="/signup" component={IDEView} />
<Route path="/reset-password" component={IDEView} />
<Route path="/projects/:project_id" component={IDEView} />
<Route path="/full/:project_id" component={FullView} />
<Route path="/sketches" component={IDEView} />

View file

@ -87,6 +87,7 @@
"moment": "^2.14.1",
"mongoose": "^4.4.16",
"node-uuid": "^1.4.7",
"nodemailer": "^2.6.4",
"passport": "^0.3.2",
"passport-github": "^1.1.0",
"passport-local": "^1.0.0",

View file

@ -6,6 +6,8 @@ const userSchema = new Schema({
name: { type: String, default: '' },
username: { type: String, required: true, unique: true },
password: { type: String },
resetPasswordToken: String,
resetPasswordExpires: Date,
github: { type: String },
email: { type: String, unique: true },
tokens: Array,

View file

@ -25,6 +25,10 @@ router.route('/login').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
});
router.route('/reset-password').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
});
router.route('/sketches').get((req, res) => {
res.sendFile(path.resolve(`${__dirname}/../../index.html`));
});