0
samalik created
I need to log out all logged-in users upon execution of a background worker (HangfireBackgroundWorkerBase). Also, I need the action inserted in the security log against this to be 'Forced Logout' instead of 'Logout'. How can I do that?
-
ABP Framework version: v8.1
-
UI Type: MVC
-
Database System: EF Core (SQL Serve)
-
**Template Type: **: Application Template
-
**Tiered (for MVC) **: No
1 Answer(s)
-
0
hi
You can do that after enabling session management. You can remove all sessions, and then the user will log out.
see https://abp.io/docs/latest/modules/identity/session-management#how-it-works
Inject the
ISecurityLogManager
to add new logs.await _securityLogManager.SaveAsync(securityLog => { securityLog.Identity = "Test"; securityLog.Action = "Test-Action"; securityLog.UserName = "Test-User"; });
https://abp.io/docs/latest/modules/identity/session-management
https://abp.io/docs/latest/modules/account/session-management