mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-07 17:02:29 +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){
|
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});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue