Эх сурвалжийг харах

[dbms] Rename JDBC 403 to 401 Unauthorized

Romain Rigaux 10 жил өмнө
parent
commit
9ec3caa

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/assistHelper.js

@@ -73,7 +73,7 @@ AssistHelper.prototype.load = function (snippet, callback) {
       callback();
     }
   }, function(message) {
-   if (message.status == 403) {
+   if (message.status == 401) {
       $(document).trigger("showAuthModal", {'type': self.type, 'callback': function() {self.loaded(false); self.load(snippet, callback) }});
     } else if (message.statusText) {
       $(document).trigger("error", "There was a problem loading the databases:" + message.statusText);

+ 1 - 1
desktop/libs/notebook/src/notebook/decorators.py

@@ -80,7 +80,7 @@ def api_error_handler(func):
     except QueryExpired, e:
       response['status'] = -3
     except AuthenticationRequired, e:
-      response['status'] = 403
+      response['status'] = 401
     except QueryError, e:
       LOG.exception('error running %s' % func)
       response['status'] = 1

+ 2 - 2
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -369,7 +369,7 @@ var Snippet = function (vm, notebook, snippet) {
     else if (data.status == -3) { // Statement expired
       self.status('expired');
     }
-    else if (data.status == 403) { // Auth required
+    else if (data.status == 401) { // Auth required
       self.status('expired');
       $(document).trigger("showAuthModal", {'type': self.type(), 'callback': self.execute});
     }
@@ -811,7 +811,7 @@ var Notebook = function (vm, notebook) {
         if (callback) {
           setTimeout(callback, 500);
         }
-      } else if (data.status == 403) {
+      } else if (data.status == 401) {
         $(document).trigger("showAuthModal", {'type': session.type()});
       }
       else {