@@ -3,6 +3,7 @@ import { requireAuthenticationAny } from '../../../middleware/oauthMiddleware';
33import { requireTeamPermission } from '../../../middleware/roleMiddleware' ;
44import { getDb } from '../../../db' ;
55import { McpInstanceService } from '../../../services/mcpInstanceService' ;
6+ import { SatelliteCommandService } from '../../../services/satelliteCommandService' ;
67import {
78 TEAM_AND_INSTALLATION_PARAMS_SCHEMA ,
89 RESET_TOKEN_SUCCESS_RESPONSE_SCHEMA ,
@@ -38,7 +39,7 @@ export default async function resetTokenRoute(server: FastifyInstance) {
3839 }
3940 }
4041 } , async ( request , reply ) => {
41- const { installationId } = request . params as TeamAndInstallationParams ;
42+ const { teamId , installationId } = request . params as TeamAndInstallationParams ;
4243 const userId = request . user ! . id ;
4344
4445 request . log . info ( {
@@ -62,6 +63,19 @@ export default async function resetTokenRoute(server: FastifyInstance) {
6263 return reply . status ( 404 ) . type ( 'application/json' ) . send ( jsonString ) ;
6364 }
6465
66+ // Notify satellite to refresh config and pick up new token hash
67+ try {
68+ const satelliteCommandService = new SatelliteCommandService ( db , request . log ) ;
69+ await satelliteCommandService . notifyMcpUpdate ( installationId , teamId , userId ) ;
70+ } catch ( commandError ) {
71+ request . log . warn ( {
72+ operation : 'reset_instance_token_satellite_notify' ,
73+ installationId,
74+ error : commandError instanceof Error ? commandError . message : 'Unknown error'
75+ } , 'Failed to notify satellite of token reset' ) ;
76+ // Non-fatal: token is already reset in DB, satellite will pick it up on next config refresh
77+ }
78+
6579 const successResponse : ResetTokenSuccessResponse = {
6680 success : true ,
6781 data : {
0 commit comments