MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / authorizeServer

Function authorizeServer

packages/ui/src/views/tools/CustomMcpServerDialog.jsx:662–688  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

660 }
661
662 const authorizeServer = async () => {
663 const targetId = serverId
664 if (!targetId) return
665 setAuthorizing(true)
666 try {
667 const resp = await customMcpServersApi.authorizeCustomMcpServer(targetId)
668 if (resp.data) {
669 setStatus(resp.data.status)
670 if (resp.data.tools) {
671 try {
672 const parsed = JSON.parse(resp.data.tools) || {}
673 const tools = Array.isArray(parsed?.tools) ? parsed.tools : []
674 setDiscoveredTools(tools)
675 showSnackbar(`Connected! Discovered ${tools.length} tools`)
676 } catch {
677 setDiscoveredTools([])
678 }
679 }
680 }
681 } catch (error) {
682 setStatus(MCP_SERVER_STATUS.ERROR)
683 showSnackbar(`Authorization failed: ${getErrorMsg(error)}`, 'error')
684 } finally {
685 setAuthorizing(false)
686 if (typeof onAuthorize === 'function') onAuthorize(targetId)
687 }
688 }
689
690 // Masked values stay visible in the form so the user keeps context. Fields
691 // left untouched still carry the masked placeholder; the backend recognises

Callers

nothing calls this directly

Calls 4

showSnackbarFunction · 0.85
getErrorMsgFunction · 0.85
onAuthorizeFunction · 0.85
parseMethod · 0.65

Tested by

no test coverage detected