feature (home): redirect to home path after authentication

This commit is contained in:
Mickael Kerjean 2018-07-18 01:53:00 +10:00
parent dd562ecc37
commit 1c7a7bf8df

View file

@ -42,9 +42,13 @@ export class ConnectPage extends React.Component {
authenticate(params){ authenticate(params){
this.setState({loading: true}); this.setState({loading: true});
Session.authenticate(params) Session.authenticate(params)
.then((ok) => { .then((path) => {
let url = '/files/';
if(path){
url += path.replace(/^\/?(.*?)\/?$/, "$1") + "/";
}
cache.destroy(); cache.destroy();
this.props.history.push('/files/'); this.props.history.push(url);
}) })
.catch((err) => { .catch((err) => {
this.setState({loading: false}); this.setState({loading: false});