Merge pull request #1591 from dpalou/MOBILE-2719

MOBILE-2719 login: Don't send fake credentials
main
Juan Leyva 2018-11-09 13:39:55 +01:00 committed by GitHub
commit 9e95285f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 10 deletions

View File

@ -378,16 +378,7 @@ export class CoreSitesProvider {
* @return {Promise} A promise to be resolved if the site exists.
*/
siteExists(siteUrl: string): Promise<void> {
const data: any = {};
if (!this.appProvider.isMobile() && !this.appProvider.isDesktop()) {
// Send fake parameters for CORS. This is only needed in browser.
data.username = 'a';
data.password = 'b';
data.service = 'c';
}
return this.http.post(siteUrl + '/login/token.php', data).timeout(CoreConstants.WS_TIMEOUT).toPromise().catch(() => {
return this.http.post(siteUrl + '/login/token.php', {}).timeout(CoreConstants.WS_TIMEOUT).toPromise().catch(() => {
// Default error messages are kinda bad, return our own message.
return Promise.reject({error: this.translate.instant('core.cannotconnect')});
}).then((data: any) => {