Skip to content

Commit 8b12b03

Browse files
committed
MOBILE-1844 login: Pass fake params only in browser
1 parent bc95f04 commit 8b12b03

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
@@ -171,11 +171,14 @@ angular.module('mm.core')
171171
* @return {Promise} A promise to be resolved if the site exists.
172172
*/
173173
self.siteExists = function(siteurl) {
174-
var data = {
175-
username: 'a',
176-
password: 'b',
177-
service: determineService(siteurl)
178-
};
174+
var data = {};
175+
176+
if (!ionic.Platform.isWebView()) {
177+
// Send fake parameters for CORS. This is only needed in browser.
178+
data.username = 'a';
179+
data.password = 'b';
180+
data.service = 'c';
181+
}
179182

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

0 commit comments

Comments
 (0)