Skip to content

Commit 7b097f9

Browse files
committed
Merge pull request #365 from dpalou/MOBILE-1397
MOBILE-1397 login: Use fake params only in browser
2 parents d73c2b4 + cf8edd1 commit 7b097f9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

www/core/lib/sitesmanager.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,12 @@ angular.module('mm.core')
128128
* @return {Promise} A promise to be resolved if the site exists.
129129
*/
130130
self.siteExists = function(siteurl) {
131-
// We pass fake parameters to make CORS work (without params, the script stops before allowing CORS).
132-
return $http.get(siteurl + '/login/token.php?username=a&password=b&service=c', {timeout: 30000});
131+
var url = siteurl + '/login/token.php';
132+
if (!ionic.Platform.isWebView()) {
133+
// We pass fake parameters to make CORS work (without params, the script stops before allowing CORS).
134+
url = url + '?username=a&password=b&service=c';
135+
}
136+
return $http.get(url, {timeout: 30000});
133137
};
134138

135139
/**

0 commit comments

Comments
 (0)