couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to 496e164
Date Wed, 10 Dec 2014 13:21:28 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master e4f42a7de -> 496e16404


Redirect to login page on access denied

An error message is displayed in Fauxton telling the user that
access is denied. While it tells them to select the login link to
log in (which does work), this is not a good user experience.

In this case, the user should be presented with the login and not
an error message.

closes COUCHDB-2435


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/496e1640
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/496e1640
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/496e1640

Branch: refs/heads/master
Commit: 496e164048c073ef58874f3fd74fa90415fbea61
Parents: e4f42a7
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Wed Dec 10 11:51:43 2014 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Wed Dec 10 14:21:04 2014 +0100

----------------------------------------------------------------------
 app/addons/auth/base.js                 |  2 +-
 app/addons/auth/routes.js               | 12 +-----------
 app/addons/auth/templates/noAccess.html | 25 -------------------------
 app/addons/auth/test/baseSpec.js        |  2 +-
 4 files changed, 3 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/496e1640/app/addons/auth/base.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/base.js b/app/addons/auth/base.js
index 966e3af..a482901 100644
--- a/app/addons/auth/base.js
+++ b/app/addons/auth/base.js
@@ -54,7 +54,7 @@ function(app, FauxtonAPI, Auth) {
 
     var authDenied = function () {
       var url = window.location.hash.replace('#','');
-      FauxtonAPI.navigate('/noAccess?urlback=' + url, {replace: true});
+      FauxtonAPI.navigate('/login?urlback=' + url, {replace: true});
     };
 
     FauxtonAPI.auth.registerAuth(auth);

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/496e1640/app/addons/auth/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/routes.js b/app/addons/auth/routes.js
index a6220b0..6512869 100644
--- a/app/addons/auth/routes.js
+++ b/app/addons/auth/routes.js
@@ -24,9 +24,7 @@ function(app, FauxtonAPI, Auth) {
       'login?*extra': 'login',
       'login': 'login',
       'logout': 'logout',
-      'createAdmin': 'createAdmin',
-      'noAccess?*extra': 'noAccess',
-      'noAccess': 'noAccess'
+      'createAdmin': 'createAdmin'
     },
 
     login: function () {
@@ -53,14 +51,6 @@ function(app, FauxtonAPI, Auth) {
     createAdmin: function () {
       this.crumbs = [{name: 'Create Admin', link:"#"}];
       this.setView('#dashboard-content', new Auth.CreateAdminView({model: FauxtonAPI.session}));
-    },
-
-    noAccess: function () {
-      var urlBack = app.getParams().urlback;
-      this.crumbs = [{name: 'Access Denied', link:"#"}];
-      this.setView('#dashboard-content', new Auth.NoAccessView({
-        urlBack: urlBack
-      }));
     }
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/496e1640/app/addons/auth/templates/noAccess.html
----------------------------------------------------------------------
diff --git a/app/addons/auth/templates/noAccess.html b/app/addons/auth/templates/noAccess.html
deleted file mode 100644
index 999624c..0000000
--- a/app/addons/auth/templates/noAccess.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<%/*
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
-*/%>
-
-<div class="span12">
-  <h2>Access Denied</h2>
-  <p>You do not have permission to view this page.</p>
-  <p>
-    <% if (user) { %>
-      Please request authorization from the server administrators.
-    <% } else { %>
-      You might need to <a href="#login<% if (urlBack){ %>?urlback=<%-urlBack%>
 <% } %> ">login</a>.
-    <% } %>
-  </p>
-</div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/496e1640/app/addons/auth/test/baseSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/test/baseSpec.js b/app/addons/auth/test/baseSpec.js
index 009aff5..177ec30 100644
--- a/app/addons/auth/test/baseSpec.js
+++ b/app/addons/auth/test/baseSpec.js
@@ -28,7 +28,7 @@ define([
         FauxtonAPI.session.isLoggedIn = function () { return false; };
         Base.initialize();
         FauxtonAPI.auth.authDeniedCb();
-        assert.ok(navigateSpy.withArgs('/noAccess?urlback=', {replace: true}).calledOnce);
+        assert.ok(navigateSpy.withArgs('/login?urlback=', {replace: true}).calledOnce);
       });
     });
   });


Mime
View raw message