mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix double change password calls (#50948)
This commit is contained in:
parent
5a35381f77
commit
32103fcd9f
@ -61,15 +61,7 @@ export class LoginCtrl extends PureComponent<Props, State> {
|
||||
oldPassword: 'admin',
|
||||
};
|
||||
|
||||
if (!this.props.resetCode) {
|
||||
getBackendSrv()
|
||||
.put('/api/user/password', pw)
|
||||
.then(() => {
|
||||
this.toGrafana();
|
||||
})
|
||||
.catch((err: any) => console.error(err));
|
||||
}
|
||||
|
||||
if (this.props.resetCode) {
|
||||
const resetModel = {
|
||||
code: this.props.resetCode,
|
||||
newPassword: password,
|
||||
@ -81,6 +73,14 @@ export class LoginCtrl extends PureComponent<Props, State> {
|
||||
.then(() => {
|
||||
this.toGrafana();
|
||||
});
|
||||
} else {
|
||||
getBackendSrv()
|
||||
.put('/api/user/password', pw)
|
||||
.then(() => {
|
||||
this.toGrafana();
|
||||
})
|
||||
.catch((err: any) => console.error(err));
|
||||
}
|
||||
};
|
||||
|
||||
login = (formModel: FormModel) => {
|
||||
|
Loading…
Reference in New Issue
Block a user