mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 10:40:01 -03:30
move login back to using finally handler and update tests
This commit is contained in:
@@ -50,14 +50,13 @@ class LoginPage extends Component {
|
||||
this.safeSetState({ loading: true });
|
||||
|
||||
api.login(username, password)
|
||||
.then(() => {
|
||||
this.safeSetState({ loading: false });
|
||||
})
|
||||
.catch(error => {
|
||||
this.safeSetState({ loading: false });
|
||||
if (error.response.status === 401) {
|
||||
this.safeSetState({ error: LOGIN_ERROR_MESSAGE });
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.safeSetState({ loading: false });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user