MOBILE-2795 login: Fix forgot password in 3.3 or older

main
Dani Palou 2019-01-03 15:41:57 +01:00
parent 7ced9ccd5d
commit 2a439224f2
2 changed files with 4 additions and 3 deletions

View File

@ -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 != '');
});
}

View File

@ -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;