forked from EVOgeek/Vmeda.Online
		
	MOBILE-4390 lang: Set lang in login/token.php
This commit is contained in:
		
							parent
							
								
									4541958d11
								
							
						
					
					
						commit
						b8618cbc93
					
				@ -62,6 +62,7 @@ import { asyncInstance, AsyncInstance } from '../utils/async-instance';
 | 
				
			|||||||
import { CoreConfig } from './config';
 | 
					import { CoreConfig } from './config';
 | 
				
			||||||
import { CoreNetwork } from '@services/network';
 | 
					import { CoreNetwork } from '@services/network';
 | 
				
			||||||
import { CoreUserGuestSupportConfig } from '@features/user/classes/support/guest-support-config';
 | 
					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_SCHEMAS = new InjectionToken<CoreSiteSchema[]>('CORE_SITE_SCHEMAS');
 | 
				
			||||||
export const CORE_SITE_CURRENT_SITE_ID_CONFIG = 'current_site_id';
 | 
					export const CORE_SITE_CURRENT_SITE_ID_CONFIG = 'current_site_id';
 | 
				
			||||||
@ -418,7 +419,10 @@ export class CoreSitesProvider {
 | 
				
			|||||||
        siteUrl = CoreUrlUtils.removeUrlParams(siteUrl);
 | 
					        siteUrl = CoreUrlUtils.removeUrlParams(siteUrl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        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();
 | 
					                .toPromise();
 | 
				
			||||||
        } catch (error) {
 | 
					        } catch (error) {
 | 
				
			||||||
            throw this.createCannotConnectLoginError(null, {
 | 
					            throw this.createCannotConnectLoginError(null, {
 | 
				
			||||||
@ -480,12 +484,13 @@ export class CoreSitesProvider {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        service = service || CoreConstants.CONFIG.wsservice;
 | 
					        service = service || CoreConstants.CONFIG.wsservice;
 | 
				
			||||||
 | 
					        const lang = await CoreLang.getCurrentLanguage();
 | 
				
			||||||
        const params = {
 | 
					        const params = {
 | 
				
			||||||
            username,
 | 
					            username,
 | 
				
			||||||
            password,
 | 
					            password,
 | 
				
			||||||
            service,
 | 
					            service,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        const loginUrl = siteUrl + '/login/token.php';
 | 
					        const loginUrl = `${siteUrl}/login/token.php?lang=${lang}`;
 | 
				
			||||||
        let data: CoreSitesLoginTokenResponse;
 | 
					        let data: CoreSitesLoginTokenResponse;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user