3using System.Threading.Tasks;
6using HotChocolate.Execution;
7using HotChocolate.Subscriptions;
8using HotChocolate.Types;
19 [GraphQLDescription(GraphQLDescription)]
25 public const string GraphQLDescription =
"Root Subscription type. Note that subscriptions are performed over Server Sent events.";
34 ArgumentNullException.ThrowIfNull(authenticationContext);
35 return $
"SessionInvalidated.{authenticationContext.SessionId}";
47 [Service] HotChocolate.Subscriptions.ITopicEventReceiver receiver,
50 CancellationToken cancellationToken)
52 ArgumentNullException.ThrowIfNull(receiver);
53 ArgumentNullException.ThrowIfNull(invalidationTracker);
56 invalidationTracker.TrackSession(authenticationContext);
68 => sessionInvalidationReason;
Root type for GraphQL subscriptions.
const string GraphQLDescription
Description to show on the Subscription type.
ValueTask< ISourceStream< SessionInvalidationReason > > SessionInvalidatedStream([Service] HotChocolate.Subscriptions.ITopicEventReceiver receiver, [Service] ISessionInvalidationTracker invalidationTracker, [Service] IAuthenticationContext authenticationContext, CancellationToken cancellationToken)
ISourceStream for SessionInvalidated(SessionInvalidationReason).
static string SessionInvalidatedTopic(IAuthenticationContext authenticationContext)
Gets the topic name for the login session represented by a given authenticationContext .
SessionInvalidationReason SessionInvalidated([EventMessage] SessionInvalidationReason sessionInvalidationReason)
Receive a SessionInvalidationReason immediately before the current login session is invalidated.
For creating and accessing authentication contexts.
Handles invalidating user sessions.
SessionInvalidationReason
Reasons TGS may invalidate a user's login session.