forked from CIT/Vmeda.Online
		
	MOBILE-2719 login: Don't send fake credentials
This commit is contained in:
		
							parent
							
								
									8ae7153ad8
								
							
						
					
					
						commit
						a98d414058
					
				| @ -378,16 +378,7 @@ export class CoreSitesProvider { | |||||||
|      * @return {Promise} A promise to be resolved if the site exists. |      * @return {Promise} A promise to be resolved if the site exists. | ||||||
|      */ |      */ | ||||||
|     siteExists(siteUrl: string): Promise<void> { |     siteExists(siteUrl: string): Promise<void> { | ||||||
|         const data: any = {}; |         return this.http.post(siteUrl + '/login/token.php', {}).timeout(CoreConstants.WS_TIMEOUT).toPromise().catch(() => { | ||||||
| 
 |  | ||||||
|         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(() => { |  | ||||||
|             // Default error messages are kinda bad, return our own message.
 |             // Default error messages are kinda bad, return our own message.
 | ||||||
|             return Promise.reject({error: this.translate.instant('core.cannotconnect')}); |             return Promise.reject({error: this.translate.instant('core.cannotconnect')}); | ||||||
|         }).then((data: any) => { |         }).then((data: any) => { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user