mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
feature (home): redirect to home path after authentication
This commit is contained in:
parent
dd562ecc37
commit
1c7a7bf8df
1 changed files with 6 additions and 2 deletions
|
|
@ -42,9 +42,13 @@ export class ConnectPage extends React.Component {
|
|||
authenticate(params){
|
||||
this.setState({loading: true});
|
||||
Session.authenticate(params)
|
||||
.then((ok) => {
|
||||
.then((path) => {
|
||||
let url = '/files/';
|
||||
if(path){
|
||||
url += path.replace(/^\/?(.*?)\/?$/, "$1") + "/";
|
||||
}
|
||||
cache.destroy();
|
||||
this.props.history.push('/files/');
|
||||
this.props.history.push(url);
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setState({loading: false});
|
||||
|
|
|
|||
Loading…
Reference in a new issue