mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-28 16:24:42 +02:00
Fixes redirection upon password recovery
This commit is contained in:
parent
ac5b72f35d
commit
e204b1877c
@ -3,6 +3,7 @@ import _ from 'lodash';
|
|||||||
|
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
|
import history from 'lib-app/history';
|
||||||
|
|
||||||
import Widget from 'core-components/widget';
|
import Widget from 'core-components/widget';
|
||||||
import Form from 'core-components/form';
|
import Form from 'core-components/form';
|
||||||
@ -73,8 +74,8 @@ class MainRecoverPasswordPage extends React.Component {
|
|||||||
}).then(this.onPasswordRecovered.bind(this)).catch(this.onPasswordRecoverFail.bind(this));
|
}).then(this.onPasswordRecovered.bind(this)).catch(this.onPasswordRecoverFail.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
onPasswordRecovered() {
|
onPasswordRecovered(response) {
|
||||||
setTimeout(() => {this.props.history.push('/')}, 2000);
|
setTimeout(() => {history.push(response.data.staff ? '/admin' : '/')}, 2000);
|
||||||
this.setState({
|
this.setState({
|
||||||
recoverStatus: 'valid',
|
recoverStatus: 'valid',
|
||||||
loading: false
|
loading: false
|
||||||
@ -89,4 +90,4 @@ class MainRecoverPasswordPage extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MainRecoverPasswordPage;
|
export default MainRecoverPasswordPage;
|
||||||
|
@ -77,7 +77,9 @@ module.exports = [
|
|||||||
if (data.password.length > 6) {
|
if (data.password.length > 6) {
|
||||||
return {
|
return {
|
||||||
status: 'success',
|
status: 'success',
|
||||||
data: {}
|
data: {
|
||||||
|
staff: true
|
||||||
|
}
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user