public async Task LogOut() { if (AbpSession.UserId != null) { var tokenValidityKeyInClaims = User.Claims.First(c => c.Type == AppConsts.TokenValidityKey); await _userManager.RemoveTokenValidityKeyAsync(_userManager.GetUser(AbpSession.ToUserIdentifier()), tokenValidityKeyInClaims.Value); _cacheManager.GetCache(AppConsts.TokenValidityKey).Remove(tokenValidityKeyInClaims.Value); if (AllowOneConcurrentLoginPerUser()) { await _securityStampHandler.RemoveSecurityStampCacheItem(AbpSession.TenantId, AbpSession.GetUserId()); } } }
public async Task LogOut() { if (AbpSession.UserId != null) { var tokenValidityKeyInClaims = User.Claims.First(c => c.Type == AppConsts.TokenValidityKey); await RemoveTokenAsync(tokenValidityKeyInClaims.Value); var refreshTokenValidityKeyInClaims = User.Claims.FirstOrDefault(c => c.Type == AppConsts.RefreshTokenValidityKey); if (refreshTokenValidityKeyInClaims != null) { await RemoveTokenAsync(refreshTokenValidityKeyInClaims.Value); } if (AllowOneConcurrentLoginPerUser()) { await _securityStampHandler.RemoveSecurityStampCacheItem( AbpSession.TenantId, AbpSession.GetUserId() ); } } }