diff --git a/src/containers/AuthenticationPage/AuthenticationPage.js b/src/containers/AuthenticationPage/AuthenticationPage.js index 5d9caacd..85de644a 100644 --- a/src/containers/AuthenticationPage/AuthenticationPage.js +++ b/src/containers/AuthenticationPage/AuthenticationPage.js @@ -1,7 +1,7 @@ import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import { Redirect } from 'react-router-dom'; -import { PageLayout, NamedLink } from '../../components'; +import { PageLayout, NamedLink, NamedRedirect } from '../../components'; import { LoginForm, SignUpForm } from '../../containers'; import { login } from '../../ducks/Auth.ducks'; @@ -10,9 +10,11 @@ export const AuthenticationPageComponent = props => { const isLogin = tab === 'login'; const from = location.state && location.state.from ? location.state.from : null; + const authRedirect = from ? : ; + return ( - {isAuthenticated ? : null} + {isAuthenticated ? authRedirect : null} {from ?

You must log in to view the page at @@ -21,8 +23,8 @@ export const AuthenticationPageComponent = props => { : null} {isLogin ? : } {isLogin - ? Sign up - : Log in} + ? Sign up + : Log in} ); };