Mercurial > lada > lada-client
comparison app/override/RestProxy.js @ 913:44d7822d0d55
Removed OpenId stuff.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 13 Aug 2015 11:48:26 +0200 |
parents | fb89f61ab272 |
children | 2bf35377414a |
comparison
equal
deleted
inserted
replaced
912:9fc4afd21f7f | 913:44d7822d0d55 |
---|---|
6 * the documentation coming with IMIS-Labordaten-Application for details. | 6 * the documentation coming with IMIS-Labordaten-Application for details. |
7 */ | 7 */ |
8 | 8 |
9 Ext.define('Lada.override.RestProxy', { | 9 Ext.define('Lada.override.RestProxy', { |
10 override: 'Ext.data.proxy.Rest', | 10 override: 'Ext.data.proxy.Rest', |
11 | 11 /* |
12 buildRequest: function (operation) { | 12 buildRequest: function (operation) { |
13 this.headers = { 'X-OPENID-PARAMS': Lada.openIDParams }; | 13 this.headers = { 'X-OPENID-PARAMS': Lada.openIDParams }; |
14 return this.callParent(arguments); | 14 return this.callParent(arguments); |
15 }, | 15 }, |
16 | 16 |
17 processResponse: function (success, operation, request, response, callback, scope) { | 17 processResponse: function (success, operation, request, response, callback, scope) { |
18 /* Check if we were authenticated at one point (Lada.openIDParams) and | 18 /* Check if we were authenticated at one point (Lada.openIDParams) and |
19 * if the response means that we lost that authentcation */ | 19 * if the response means that we lost that authentcation |
20 if (Lada.openIDParams && !success && response.status == 401) { | 20 if (Lada.openIDParams && !success && response.status == 401) { |
21 var json = Ext.decode(response.responseText); | 21 var json = Ext.decode(response.responseText); |
22 if (json) { | 22 if (json) { |
23 if (json.message === "699" || json.message === "698") { | 23 if (json.message === "699" || json.message === "698") { |
24 /* This is the unauthorized message with the authentication | 24 /* This is the unauthorized message with the authentication |
25 * redirect in the data */ | 25 * redirect in the data |
26 | 26 |
27 /* We decided to handle this with a redirect to the identity | 27 /* We decided to handle this with a redirect to the identity |
28 * provider. In which case we have no other option then to | 28 * provider. In which case we have no other option then to |
29 * handle it here with relaunch. */ | 29 * handle it here with relaunch. |
30 Ext.MessageBox.confirm('Erneutes Login erforderlich', | 30 Ext.MessageBox.confirm('Erneutes Login erforderlich', |
31 'Der Server konnte die Anfrage nicht authentifizieren.<br/>'+ | 31 'Der Server konnte die Anfrage nicht authentifizieren.<br/>'+ |
32 'Für ein erneutes Login muss die Anwendung neu geladen werden.<br/>' + | 32 'Für ein erneutes Login muss die Anwendung neu geladen werden.<br/>' + |
33 'Alle ungesicherten Daten gehen dabei verloren.<br/>' + | 33 'Alle ungesicherten Daten gehen dabei verloren.<br/>' + |
34 'Soll die Anwendung jetzt neu geladen werden?', this.reload); | 34 'Soll die Anwendung jetzt neu geladen werden?', this.reload); |
35 } | 35 } |
36 } | 36 } |
37 } | 37 } |
38 this.callParent(arguments); | 38 this.callParent(arguments); |
39 }, | 39 }, |
40 */ | |
40 reload: function(btn) { | 41 reload: function(btn) { |
41 if (btn === 'yes') { | 42 if (btn === 'yes') { |
42 location.reload(); | 43 location.reload(); |
43 } | 44 } |
44 } | 45 } |