how to disconnect the twitch with my game? if user disconnect from Twitch ,will my game server can recieve notification? if no notification,ther user disconnect from twitch,but the user to twtich mapping is still in my gameserver? how to process the disconnect action from user?
EventSub has a user.authentication.revoke topic that you could subscribe to, https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/#userauthorizationrevoke, which will send notifications when a user revokes their connection to your app.
Additionally, another way to check would be to store the users Access and Refresh tokens when the initially connect to your app, and periodically validating the token and when it expires use the refresh token with the Refresh Token endpoint https://dev.twitch.tv/docs/authentication/refresh-tokens/. If the access token becomes invalid and you get an error when using the refresh tokens endpoint that would likely indicate the user has disconnected form your app.
What solution will be best depends on what auth flow you’re using and how you’re handling tokens.
thanks
This topic was automatically closed after 30 days. New replies are no longer allowed.