0
demo.solaru created
Hello,
When .Net Core is not able to validate token: it throws this error message and automatically reloads page on Angular.
- Wants to change verbaige of this message: "Current User Did Not Login To Application" -- I already tried changing it in .xml file for localization but its not overridding.
- After token expiry I don't want anguler to auto reload the page but let user click on "Ok" button and then wants to reload the page.
Using Aspnetzero 7.0.0.
Any help would be appriciated. Thank you!
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
3 Answer(s)
-
1
Hi,
- This message is defined in https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Localization/Sources/AbpXmlSource/Abp.xml#L15. So you need to override it as explained here
- This is handled here https://github.com/aspnetboilerplate/abp-ng2-module/blob/master/projects/abp-ng2-module/src/lib/interceptors/abp-http-configuration.service.ts#L58. You can override it as shown below;
import { AbpHttpConfigurationService } from 'abp-ng2-module';
@Injectable() export class HttpConfigurationService extends AbpHttpConfigurationService { handleUnAuthorizedRequest(messagePromise: any, targetUrl?: string) { const self = this; if (messagePromise) { messagePromise.done(() => { this.handleTargetUrl(targetUrl || '/'); }); } else { self.handleTargetUrl(targetUrl || '/'); } } }and replace in the app;
providers: [{provide: AbpHttpConfigurationService, useClass: HttpConfigurationService}],Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thank you @ismcagdas
Just a one more question: where we need to add " providers: [{provide: AbpHttpConfigurationService, useClass: HttpConfigurationService}]," ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @demo.solaru
You can do it in the app module.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)