[Lada-commits] [PATCH 5 of 5] Use rest response handler to act on unauthenticated request
Wald Commits
scm-commit at wald.intevation.org
Fri Aug 14 09:37:51 CEST 2015
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1439537506 -7200
# Node ID 2bf35377414afd5018219ff97cd8226d25a2e7c5
# Parent 323f02e6e51428fa8c1da525a179d987cbf52f5c
Use rest response handler to act on unauthenticated request.
diff -r 323f02e6e514 -r 2bf35377414a app/override/RestProxy.js
--- 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();
More information about the Lada-commits
mailing list