Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:
- ABP Framework version: v7.4.1
- UI Type: Angular
- Database System: EF Core
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
We want to manage the users session in such a way that after 20 minutes of inactivity a popup appears that asks the user if he wants to stay connected, if he doesn't press yes he will logout.
How can we do that?
Thank you
3 Answer(s)
-
0
hi
There is an angular method to clear the login state.
https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/oauth/src/lib/utils/clear-o-auth-storage.ts#L4
-
0
devpayoff:
I used: builder.SetAccessTokenLifetime(TimeSpan.FromMinutes(20)); for making the token expire after 20 minutes. In angular i subscribed to the token refresh expiration event so when the token expire a modal appear this.oAuthService.events .pipe(filter(event => event.type === 'token_refresh_error')) .subscribe(() => { this.modalVisible = true; }); Problem is that when a token expire abp redirect me to login page. How can i remove/override that abp behavior?
-
0
hi
Problem is that when a token expire abp redirect me to login page. How can i remove/override that abp behavior?
I think the behavior comes from: https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/oauth/src/lib/strategies/auth-flow-strategy.ts#L76-L78