Skip to content

Commit 816266e

Browse files
authored
Merge pull request #708 from dpalou/MOBILE-1844
MOBILE-1844 login: Pass fake params only in browser
2 parents 8780579 + 8b12b03 commit 816266e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

www/core/lib/sitesmanager.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,14 @@ angular.module('mm.core')
217217
* @return {Promise} A promise to be resolved if the site exists.
218218
*/
219219
self.siteExists = function(siteurl) {
220-
var data = {
221-
username: 'a',
222-
password: 'b',
223-
service: determineService(siteurl)
224-
};
220+
var data = {};
221+
222+
if (!ionic.Platform.isWebView()) {
223+
// Send fake parameters for CORS. This is only needed in browser.
224+
data.username = 'a';
225+
data.password = 'b';
226+
data.service = 'c';
227+
}
225228

226229
return $http.post(siteurl + '/login/token.php', data, {timeout: 30000, responseType: 'json'}).then(function(data) {
227230
data = data.data;

0 commit comments

Comments
 (0)