MOBILE-2352 login: Fix error handling in login

main
Dani Palou 2018-05-22 13:04:22 +02:00
parent 27129c373e
commit fb59c5944b
1 changed files with 3 additions and 5 deletions

View File

@ -950,12 +950,10 @@ export class CoreLoginHelperProvider {
* @param {any} error Error object containing errorcode and error message.
*/
treatUserTokenError(siteUrl: string, error: any): void {
if (typeof error == 'string') {
this.domUtils.showErrorModal(error);
} else if (error.errorcode == 'forcepasswordchangenotice') {
this.openChangePassword(siteUrl, error.error);
if (error.errorcode == 'forcepasswordchangenotice') {
this.openChangePassword(siteUrl, error.error || error.message || error.body || error.content);
} else {
this.domUtils.showErrorModal(error.error);
this.domUtils.showErrorModal(error);
}
}