Merge pull request #3749 from NoelDeMartin/MOBILE-4390
MOBILE-4390 lang: Set lang in login/token.phpmain
commit
c843090de0
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue