From 25b1b686558f5c2ae30459edccf1d5657460a727 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Fri, 18 Sep 2020 12:10:38 +0100 Subject: [PATCH] MOBILE-3556 Login: Send extra parameter on token.php check The extra parameter can be used by Moodle to avoid throwing an error in server logs because other parameters e.g. username are not supplied. --- src/providers/sites.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/providers/sites.ts b/src/providers/sites.ts index aed300a25..c11732038 100644 --- a/src/providers/sites.ts +++ b/src/providers/sites.ts @@ -641,7 +641,8 @@ export class CoreSitesProvider { * @return A promise to be resolved if the site exists. */ siteExists(siteUrl: string): Promise { - return this.http.post(siteUrl + '/login/token.php', {}).timeout(this.wsProvider.getRequestTimeout()).toPromise() + return this.http.post(siteUrl + '/login/token.php', { appsitecheck: 1 }). + timeout(this.wsProvider.getRequestTimeout()).toPromise() .catch(() => { // Default error messages are kinda bad, return our own message. return Promise.reject({error: this.translate.instant('core.cannotconnecttrouble')});