# HG changeset patch # User Raimund Renkert # 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.
'+ + 'Ihre Session ist abgelaufen.
'+ 'Für ein erneutes Login muss die Anwendung neu geladen werden.
' + 'Alle ungesicherten Daten gehen dabei verloren.
' + 'Soll die Anwendung jetzt neu geladen werden?', this.reload); @@ -37,7 +37,7 @@ } this.callParent(arguments); }, -*/ + reload: function(btn) { if (btn === 'yes') { location.reload();