MOBILE-4270 core: Report login errors
parent
92f65b38ad
commit
6ce688e76c
|
@ -499,19 +499,21 @@ export class CoreSitesProvider {
|
||||||
try {
|
try {
|
||||||
data = await firstValueFrom(Http.post(loginUrl, params).pipe(timeout(CoreWS.getRequestTimeout())));
|
data = await firstValueFrom(Http.post(loginUrl, params).pipe(timeout(CoreWS.getRequestTimeout())));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new CoreError(
|
throw this.createCannotConnectLoginError(siteUrl, {
|
||||||
this.isLoggedIn()
|
debug: {
|
||||||
? Translate.instant('core.siteunavailablehelp', { site: this.currentSite?.siteUrl })
|
code: 'logintokenerror',
|
||||||
: Translate.instant('core.sitenotfoundhelp'),
|
details: error.message,
|
||||||
);
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data === undefined) {
|
if (data === undefined) {
|
||||||
throw new CoreError(
|
throw this.createCannotConnectLoginError(siteUrl, {
|
||||||
this.isLoggedIn()
|
debug: {
|
||||||
? Translate.instant('core.siteunavailablehelp', { site: this.currentSite?.siteUrl })
|
code: 'logintokenempty',
|
||||||
: Translate.instant('core.sitenotfoundhelp'),
|
details: 'The request to /login/token.php returned an empty response',
|
||||||
);
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.token !== undefined) {
|
if (data.token !== undefined) {
|
||||||
|
|
Loading…
Reference in New Issue