changeset 917:2bf35377414a

Use rest response handler to act on unauthenticated request.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 14 Aug 2015 09:31:46 +0200
parents 323f02e6e514
children 9358c5feb843
files app/override/RestProxy.js
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/app/override/RestProxy.js	Thu Aug 13 12:54:00 2015 +0200
+++ b/app/override/RestProxy.js	Fri Aug 14 09:31:46 2015 +0200
@@ -13,22 +13,22 @@
         this.headers = { 'X-OPENID-PARAMS': Lada.openIDParams };
         return this.callParent(arguments);
     },
-
+*/
     processResponse: function (success, operation, request, response, callback, scope) {
         /* Check if we were authenticated at one point (Lada.openIDParams) and
-         * if the response means that we lost that authentcation
-        if (Lada.openIDParams && !success && response.status == 401) {
+         * if the response means that we lost that authentcation */
+        if (!success && response.status == 401) {
             var json = Ext.decode(response.responseText);
             if (json) {
                 if (json.message === "699" || json.message === "698") {
                     /* This is the unauthorized message with the authentication
-                     * redirect in the data 
+                     * redirect in the data */
 
                     /* We decided to handle this with a redirect to the identity
                      * provider. In which case we have no other option then to
-                     * handle it here with relaunch. 
+                     * handle it here with relaunch. */
                     Ext.MessageBox.confirm('Erneutes Login erforderlich',
-                        'Der Server konnte die Anfrage nicht authentifizieren.<br/>'+
+                        'Ihre Session ist abgelaufen.<br/>'+
                         'Für ein erneutes Login muss die Anwendung neu geladen werden.<br/>' +
                         'Alle ungesicherten Daten gehen dabei verloren.<br/>' +
                         'Soll die Anwendung jetzt neu geladen werden?', this.reload);
@@ -37,7 +37,7 @@
         }
         this.callParent(arguments);
     },
-*/
+
     reload: function(btn) {
         if (btn === 'yes') {
             location.reload();

http://lada.wald.intevation.org