feat: add user token secret management for channels
- Implemented user token secret generation and retrieval in channel service. - Added ResetUserTokenSecret method to reset the user token secret for channels. - Updated channel configuration parsing to include user token secret. - Enhanced WebSocket service to utilize user token secret for external info retrieval. - Modified dashboard channel edit component to support user token secret display and reset functionality. - Introduced API endpoint for resetting user token secret. - Updated IM and SDK configurations to include user token. - Added tests for user token verification logic.
This commit is contained in:
@@ -205,6 +205,10 @@ export type UpdateAdminChannelPayload = CreateAdminChannelPayload & {
|
||||
id: number
|
||||
}
|
||||
|
||||
export type ResetChannelUserTokenSecretResult = {
|
||||
userTokenSecret: string
|
||||
}
|
||||
|
||||
export type AIAgent = {
|
||||
id: number
|
||||
name: string
|
||||
@@ -589,6 +593,16 @@ export function updateChannelStatus(id: number, status: number) {
|
||||
})
|
||||
}
|
||||
|
||||
export function resetChannelUserTokenSecret(id: number) {
|
||||
return request<ResetChannelUserTokenSecretResult>(
|
||||
"/api/dashboard/channel/reset_user_token_secret",
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({ id }),
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function deleteChannel(id: number) {
|
||||
return request<void>("/api/dashboard/channel/delete", {
|
||||
method: "POST",
|
||||
|
||||
Reference in New Issue
Block a user