コード例 #1
0
        public async Task SignOutAsync(LogoutModel logoutModel)
        {
            // In fact, we just add a signout date for auditing
            // Because JWT is helping us to validate service-self instead of connecting back to Identity Server
            // For micro-services, we need to implement distributed JWT cache for signing out all sessions

            var userSession = await _userSessionRepository.GetOneAsync(logoutModel.UserSession);

            userSession.SignOutDate    = DateTime.UtcNow;
            userSession.AlreadySignOut = true;
            await _userSessionRepository.UpdateAsync(userSession.Id, userSession);
        }