Merge pull request #3749 from NoelDeMartin/MOBILE-4390

MOBILE-4390 lang: Set lang in login/token.php
main
Dani Palou 2023-07-24 15:46:48 +02:00 committed by GitHub
commit c843090de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -62,6 +62,7 @@ import { asyncInstance, AsyncInstance } from '../utils/async-instance';
import { CoreConfig } from './config';
import { CoreNetwork } from '@services/network';
import { CoreUserGuestSupportConfig } from '@features/user/classes/support/guest-support-config';
import { CoreLang } from '@services/lang';
export const CORE_SITE_SCHEMAS = new InjectionToken<CoreSiteSchema[]>('CORE_SITE_SCHEMAS');
export const CORE_SITE_CURRENT_SITE_ID_CONFIG = 'current_site_id';
@ -418,7 +419,10 @@ export class CoreSitesProvider {
siteUrl = CoreUrlUtils.removeUrlParams(siteUrl);
try {
data = await Http.post(siteUrl + '/login/token.php', { appsitecheck: 1 }).pipe(timeout(CoreWS.getRequestTimeout()))
const lang = await CoreLang.getCurrentLanguage();
data = await Http.post(`${siteUrl}/login/token.php?lang=${lang}`, { appsitecheck: 1 })
.pipe(timeout(CoreWS.getRequestTimeout()))
.toPromise();
} catch (error) {
throw this.createCannotConnectLoginError(null, {
@ -480,12 +484,13 @@ export class CoreSitesProvider {
}
service = service || CoreConstants.CONFIG.wsservice;
const lang = await CoreLang.getCurrentLanguage();
const params = {
username,
password,
service,
};
const loginUrl = siteUrl + '/login/token.php';
const loginUrl = `${siteUrl}/login/token.php?lang=${lang}`;
let data: CoreSitesLoginTokenResponse;
try {