andre@608: /* Copyright (C) 2015 by Bundesamt fuer Strahlenschutz andre@608: * Software engineering by Intevation GmbH andre@608: * andre@608: * This file is Free Software under the GNU GPL (v>=3) andre@608: * and comes with ABSOLUTELY NO WARRANTY! Check out andre@608: * the documentation coming with IMIS-Labordaten-Application for details. andre@608: */ andre@608: andre@608: Ext.define('Lada.override.RestProxy', { andre@608: override: 'Ext.data.proxy.Rest', andre@608: andre@608: buildRequest: function (operation) { andre@608: this.headers = { 'X-OPENID-PARAMS': Lada.openIDParams }; andre@608: return this.callParent(arguments); andre@608: }, andre@608: andre@608: processResponse: function (success, operation, request, response, callback, scope) { andre@608: if (!success && response.status == 401) { andre@608: var json = Ext.decode(response.responseText); andre@608: if (json) { andre@608: if (json.message == "699") { andre@608: /* This is the unauthorized message with the authentication andre@608: * redirect in the data */ andre@608: andre@608: /* We decided to handle this with a redirect to the identity andre@608: * provider. In which case we have no other option then to andre@608: * handle it here with relaunch. */ andre@608: Lada.launch(); // Data loss! andre@608: } andre@608: } andre@608: } andre@608: this.callParent(arguments); andre@608: } andre@608: });