MOBILE-3316 core: Handle wsaccessuserdeleted error

main
Noel De Martin 2022-01-27 16:28:45 +01:00
parent 3ae6eebebf
commit 94c1430762
3 changed files with 3 additions and 3 deletions

View File

@ -610,7 +610,7 @@ export class CoreSite {
CoreEvents.trigger(CoreEvents.SESSION_EXPIRED, {}, this.id); CoreEvents.trigger(CoreEvents.SESSION_EXPIRED, {}, this.id);
// Change error message. Try to get data from cache, the event will handle the error. // Change error message. Try to get data from cache, the event will handle the error.
error.message = Translate.instant('core.lostconnection'); error.message = Translate.instant('core.lostconnection');
} else if (error.errorcode === 'userdeleted') { } else if (error.errorcode === 'userdeleted' || error.errorcode === 'wsaccessuserdeleted') {
// User deleted, trigger event. // User deleted, trigger event.
CoreEvents.trigger(CoreEvents.USER_DELETED, { params: data }, this.id); CoreEvents.trigger(CoreEvents.USER_DELETED, { params: data }, this.id);
error.message = Translate.instant('core.userdeleted'); error.message = Translate.instant('core.userdeleted');

View File

@ -114,7 +114,7 @@ export class CoreUserProfilePage implements OnInit, OnDestroy {
try { try {
await CoreUser.logView(this.userId, this.courseId, this.user.fullname); await CoreUser.logView(this.userId, this.courseId, this.user.fullname);
} catch (error) { } catch (error) {
this.isDeleted = error?.errorcode === 'userdeleted'; this.isDeleted = error?.errorcode === 'userdeleted' || error?.errorcode === 'wsaccessuserdeleted';
this.isSuspended = error?.errorcode === 'wsaccessusersuspended'; this.isSuspended = error?.errorcode === 'wsaccessusersuspended';
this.isEnrolled = error?.errorcode !== 'notenrolledprofile'; this.isEnrolled = error?.errorcode !== 'notenrolledprofile';
} }

View File

@ -862,7 +862,7 @@ export class CoreUtilsProvider {
error.errorcode != 'userdeleted' && error.errorcode != 'upgraderunning' && error.errorcode != 'userdeleted' && error.errorcode != 'upgraderunning' &&
error.errorcode != 'forcepasswordchangenotice' && error.errorcode != 'usernotfullysetup' && error.errorcode != 'forcepasswordchangenotice' && error.errorcode != 'usernotfullysetup' &&
error.errorcode != 'sitepolicynotagreed' && error.errorcode != 'sitemaintenance' && error.errorcode != 'sitepolicynotagreed' && error.errorcode != 'sitemaintenance' &&
error.errorcode != 'wsaccessusersuspended' && error.errorcode != 'wsaccessusersuspended' && error.errorcode != 'wsaccessuserdeleted' &&
!this.isExpiredTokenError(error))); !this.isExpiredTokenError(error)));
} }