comparison app.js @ 669:8756f7e423fb openid

Cosmetics.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 19 Mar 2015 14:30:06 +0100
parents 3e91716f5862
children 39dd18124ebd
comparison
equal deleted inserted replaced
668:3e91716f5862 669:8756f7e423fb
72 success: this.onLoginSuccess, 72 success: this.onLoginSuccess,
73 failure: this.onLoginFailure 73 failure: this.onLoginFailure
74 }); 74 });
75 }, 75 },
76 76
77 onLoginFailure : function(response, opts) { 77 onLoginFailure: function(response) {
78 try { 78 try {
79 var json = Ext.decode(response.responseText); 79 var json = Ext.decode(response.responseText);
80 if (json) { 80 if (json) {
81 if (json.message == "699") { 81 if (json.message === '699') {
82 /* This is the unauthorized message with the authentication 82 /* This is the unauthorized message with the authentication
83 * redirect in the data */ 83 * redirect in the data */
84 var authUrl = json.data; 84 var authUrl = json.data;
85 location.href = authUrl; 85 location.href = authUrl;
86 return; 86 return;
87 } 87 }
88 if (json.message == "698") { 88 if (json.message === '698') {
89 /* This is general authentication error */ 89 /* This is general authentication error */
90 Ext.MessageBox.alert('Kommunikation mit dem Login Server fehlgeschlagen', 90 Ext.MessageBox.alert('Kommunikation mit dem Login Server fehlgeschlagen',
91 json.data); 91 json.data);
92 return; 92 return;
93 } 93 }
94 } 94 }
95 } catch (e) { 95 }
96 catch (e) {
96 // This is likely a 404 or some unknown error. Show general error then. 97 // This is likely a 404 or some unknown error. Show general error then.
97 } 98 }
98 Ext.MessageBox.alert('Kommunikation mit dem Lada Server fehlgeschlagen', 99 Ext.MessageBox.alert('Kommunikation mit dem Lada Server fehlgeschlagen',
99 'Es konnte keine erfolgreiche Verbindung zum lada server aufgebaut werden.'); 100 'Es konnte keine erfolgreiche Verbindung zum lada server aufgebaut werden.');
100
101 }, 101 },
102 102
103 onLoginSuccess: function(response, opts) { 103 onLoginSuccess: function() {
104 /* Strip out the openid query params to look nicers. */ 104 /* Strip out the openid query params to look nicers. */
105 window.history.pushState(this.name, this.name, window.location.pathname); 105 window.history.pushState(this.name, this.name, window.location.pathname);
106 106
107 Ext.create('Lada.view.Viewport'); 107 Ext.create('Lada.view.Viewport');
108 108

http://lada.wald.intevation.org