0
dev1.abp.advantiss created
- ABP Framework version: v4.3.3
- UI type: Angular
- DB provider: MongoDB
- Tiered (MVC) or Identity Server Separated (Angular): yes
I would like to logout current user.
I use for it await SignInManager.SignOutAsync();
Also try this await SignInManager.Context.SignOutAsync();
But nothing happened. When refreshing browser page, user is still login in system. Why? How do proper logout?
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
5 Answer(s)
-
0
Hi @dev1.abp.advantiss, can you try the below code:
public IdentitySecurityLogManager IdentitySecurityLogManager {get;set;} public AbpSignInManager SignInManager {get; set;} //or //public SignInManager<IdentityUser> SignInManager { get; set; } await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext() { Identity = IdentitySecurityLogIdentityConsts.Identity, Action = IdentitySecurityLogActionConsts.Logout }); await SignInManager.SignOutAsync();Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi @dev1.abp.advantiss, can you try the below code:
public IdentitySecurityLogManager IdentitySecurityLogManager {get;set;} public AbpSignInManager SignInManager {get; set;} //or //public SignInManager<IdentityUser> SignInManager { get; set; } await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext() { Identity = IdentitySecurityLogIdentityConsts.Identity, Action = IdentitySecurityLogActionConsts.Logout }); await SignInManager.SignOutAsync();Nothing is happened. After this code I check
CurrentUser.IsAuthenticatedand it's stilltrue.Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
But nothing happened. When refreshing browser page, user is still login in system.
Do you mean Angular app still have the state?
Yes
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)