zRains commented on code in PR #3941:
URL: https://github.com/apache/ambari/pull/3941#discussion_r1944063400
##########
ambari-web/app/router.js:
##########
@@ -284,15 +284,15 @@ App.Router = Em.Router.extend({
var dfd = $.Deferred();
var self = this;
var auth = App.db.getAuthenticated();
- this.getClusterDataRequest().always(function (xhr) {
- if (xhr) {
+ this.getClusterDataRequest().always(function (xhr, textStatus,
jqXHRorErrorThrown) {
+ if (xhr && textStatus == 'success') {
// if server knows the user and user authenticated by UI
if (auth) {
dfd.resolve(self.get('loggedIn'));
// if server knows the user but UI don't, check the response header
// and try to authorize
- } else if (xhr.getResponseHeader('User')) {
- var user = xhr.getResponseHeader('User');
+ } else if (jqXHRorErrorThrown.getResponseHeader('User')) {
+ var user = jqXHRorErrorThrown.getResponseHeader('User');
Review Comment:
`jqXHRorErrorThrown` will be `errorThrown` when reuqest failed, Could this
lead to the same issue?
```text
Uncaught TypeError: jqXHRorErrorThrown.getResponseHeader is not a function
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]