diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-17 02:25:36 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-17 02:25:36 +0200 |
| commit | 4c18946614657a9f8955408e514172a74eacc28e (patch) | |
| tree | 1fa92e5e7f798203d40e846bd8577b0459af1fcd /app/client/auth/login.component.js | |
| parent | 7ef59901e08b6610f134c696876695cf52061f48 (diff) | |
logging i
Diffstat (limited to 'app/client/auth/login.component.js')
| -rw-r--r-- | app/client/auth/login.component.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/client/auth/login.component.js b/app/client/auth/login.component.js index 3cfcb78..2ef01a6 100644 --- a/app/client/auth/login.component.js +++ b/app/client/auth/login.component.js @@ -31,7 +31,11 @@ class Login extends Component { } render(){ if (this.props.auth.isAuthenticated) { - return <Redirect to={this.props.auth.returnTo || '/'} /> + let { returnTo } = this.props.auth + if (!returnTo || returnTo.match(/(login|logout|signup)/i)) { + returnTo = '/' + } + return <Redirect to={returnTo} /> } return ( <form onSubmit={this.handleSubmit}> |
