Hi,
When a user access token expires while using the angular app, a popup message "CurrentUserDidNotLoginToTheApplication" is shown to the user. The problem is that the user is redirected to the login page and he has no time to read the reason why he is redirected.
How can I fix that ?
Can I fix that by implementing ZeroTemplateHttpInterceptor ?
Thanks
3 Answer(s)
-
0
Hi @Ricavir
Sorry for the late reply. Could you please make the following change? This will use
theninstead of promisedoneto wait for the user to close the message. Could you please let us know if this change resolves the issue on your end?File:
zero-template-http-configuration.service.tshandleUnAuthorizedRequest(messagePromise: any, targetUrl?: string) { if ( this._route.url && (this._route.url.startsWith('/account/login') || this._route.url.startsWith('/account/session-locked')) ) { return; } const self = this; if (messagePromise) { if (messagePromise.then) { messagePromise.then(() => { this.handleTargetUrl(targetUrl || abp.appPath); }); } else if (messagePromise.done) { messagePromise.done(() => { this.handleTargetUrl(targetUrl || abp.appPath); }); } } else { self.handleTargetUrl(targetUrl || abp.appPath); } }If the problem still persists, please feel free to contact us. Thank you.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @oguzhanagir,
I've tried your suggestion but it didn't worked. Actually, I found the issue on class AbpHttpConfigurationService on method "handleAbpResponse"
The promise from error message is not passed as argument to handleUnAuthorizedRequest method
I've overrided it to fix this issue :
handleAbpResponse(response: HttpResponse<any>, ajaxResponse: IAjaxResponse): HttpResponse<any> { var newResponse: HttpResponse<any>; if (ajaxResponse.success) { newResponse = response.clone({ body: ajaxResponse.result }); if (ajaxResponse.targetUrl) { this.handleTargetUrl(ajaxResponse.targetUrl);; } } else { newResponse = response.clone({ body: ajaxResponse.result }); if (!ajaxResponse.error) { ajaxResponse.error = this.defaultError; } this.logError(ajaxResponse.error); var **messagePromise **= this.showError(ajaxResponse.error); if (response.status === 401) { this.handleUnAuthorizedRequest(**messagePromise**, ajaxResponse.targetUrl); } } return newResponse; }Whaat do you think ? Could you fix this issue on your side as well ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @Ricavir
Thank you for your feedback and assistance. I will create an issue to resolve this issue. I will notify you when this package is released. Thank you.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)