summaryrefslogtreecommitdiff
path: root/app/client/auth/login.component.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-09-17 02:25:36 +0200
committerJules Laplace <julescarbon@gmail.com>2018-09-17 02:25:36 +0200
commit4c18946614657a9f8955408e514172a74eacc28e (patch)
tree1fa92e5e7f798203d40e846bd8577b0459af1fcd /app/client/auth/login.component.js
parent7ef59901e08b6610f134c696876695cf52061f48 (diff)
logging i
Diffstat (limited to 'app/client/auth/login.component.js')
-rw-r--r--app/client/auth/login.component.js6
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}>