diff --git a/src/Routes.js b/src/Routes.js
index 77ed92b2..3938b7c8 100644
--- a/src/Routes.js
+++ b/src/Routes.js
@@ -10,10 +10,14 @@ import routesConfiguration, { flattenRoutes, pathByRouteName } from './routesCon
export const fakeAuth = {
isAuthenticated: false,
authenticate(cb) {
+ // eslint-disable-next-line no-console
+ console.log('fakeAuth: authenticate');
this.isAuthenticated = true;
window.setTimeout(cb, 100); // fake async
},
signout(cb) {
+ // eslint-disable-next-line no-console
+ console.log('fakeAuth: signout');
this.isAuthenticated = false;
cb();
window.setTimeout(cb, 100); // weird bug if async?
diff --git a/src/containers/AuthenticationPage/AuthenticationPage.js b/src/containers/AuthenticationPage/AuthenticationPage.js
index 452b9faf..6ab4e8f8 100644
--- a/src/containers/AuthenticationPage/AuthenticationPage.js
+++ b/src/containers/AuthenticationPage/AuthenticationPage.js
@@ -1,6 +1,7 @@
import React, { Component, PropTypes } from 'react';
import { Link, Redirect } from 'react-router';
import { PageLayout } from '../../components';
+import { LoginForm, SignUpForm } from '../../containers';
import { fakeAuth } from '../../Routes';
class AuthenticationPage extends Component {
@@ -8,10 +9,21 @@ class AuthenticationPage extends Component {
super(props);
this.state = { redirectToReferrer: false };
- this.login = this.login.bind(this);
+ this.handleLogIn = this.handleLogIn.bind(this);
+ this.handleSignUp = this.handleSignUp.bind(this);
}
- login() {
+ handleLogIn(values) {
+ // eslint-disable-next-line no-console
+ console.log('log in with values:', values);
+ fakeAuth.authenticate(() => {
+ this.setState({ redirectToReferrer: true });
+ });
+ }
+
+ handleSignUp(values) {
+ // eslint-disable-next-line no-console
+ console.log('sign up with values:', values);
fakeAuth.authenticate(() => {
this.setState({ redirectToReferrer: true });
});
@@ -20,7 +32,7 @@ class AuthenticationPage extends Component {
render() {
const from = this.props.location.state && this.props.location.state.from
? this.props.location.state.from
- : '/';
+ : null;
const { redirectToReferrer } = this.state;
const toLogin = Log in;
@@ -28,9 +40,12 @@ class AuthenticationPage extends Component {
Sign up
);
const alternativeMethod = this.props.tab === 'login' ? toSignup : toLogin;
- const currentMethod = this.props.tab === 'login' ? 'Log in' : 'Sign up';
- const fromLoginMsg = from ? (
+ const form = this.props.tab === 'login'
+ ?
You must log in to view the page at
or {alternativeMethod}{from.pathname}
@@ -41,8 +56,8 @@ class AuthenticationPage extends Component {
- You must log in to view the page at
-
-
- or - - Log in - -
+ + + Log in + `; diff --git a/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js b/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js index 2d6a4cf5..c99af0f2 100644 --- a/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js +++ b/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js @@ -5,8 +5,6 @@ const ChangeAccountPasswordForm = props => { const { handleSubmit, pristine, submitting } = props; return (