From 2a439224f2d99603894acd501c5e7736f08ca6ed Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 3 Jan 2019 15:41:57 +0100 Subject: [PATCH] MOBILE-2795 login: Fix forgot password in 3.3 or older --- src/core/login/providers/helper.ts | 3 ++- src/providers/ws.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/login/providers/helper.ts b/src/core/login/providers/helper.ts index f254071dc..af4bb667f 100644 --- a/src/core/login/providers/helper.ts +++ b/src/core/login/providers/helper.ts @@ -203,7 +203,8 @@ export class CoreLoginHelperProvider { return this.requestPasswordReset(siteUrl).then(() => { return true; }).catch((error) => { - return error.available == 1 || (error.errorcode != 'invalidrecord' && error.errorcode != ''); + return error.available == 1 || (typeof error.errorcode != 'undefined' && error.errorcode != 'invalidrecord' && + error.errorcode != ''); }); } diff --git a/src/providers/ws.ts b/src/providers/ws.ts index 84c85bd71..7372bbfff 100644 --- a/src/providers/ws.ts +++ b/src/providers/ws.ts @@ -254,14 +254,14 @@ export class CoreWSProvider { if (!data || typeof data != 'object') { return rejectWithError(this.createFakeWSError('core.serverconnection', true)); } else if (data.error) { - return rejectWithError(data.error); + return rejectWithError(data); } // Get the first response since only one request was done. data = data[0]; if (data.error) { - return rejectWithError(data.exception); + return rejectWithError(data); } return data.data;