MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / handleApproveMagicLinkPost

Method handleApproveMagicLinkPost

internal/agent/hitl_magic_api.go:80–98  ·  view source on GitHub ↗

--- POST executors ---

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

78// --- POST executors ---
79
80func (a *API) handleApproveMagicLinkPost(w http.ResponseWriter, r *http.Request) {
81 if a.approvalSigner == nil {
82 http.NotFound(w, r)
83 return
84 }
85 token := extractFormToken(r)
86 claims, status, errMsg := a.verifyMagicToken(token, approvaltoken.ActionApprove)
87 if errMsg != "" {
88 writeMagicMessage(w, status, "Invalid confirmation", errMsg)
89 return
90 }
91 userID, agentID, err := a.store.ResolveOutboundOwner(r.Context(), claims.MessageID)
92 if err != nil {
93 writeMagicMessage(w, http.StatusNotFound, "Message not found",
94 "This message no longer exists.")
95 return
96 }
97 a.magicApprove(w, r, claims.MessageID, userID, agentID)
98}
99
100func (a *API) handleRejectMagicLinkPost(w http.ResponseWriter, r *http.Request) {
101 if a.approvalSigner == nil {

Callers

nothing calls this directly

Calls 5

verifyMagicTokenMethod · 0.95
magicApproveMethod · 0.95
extractFormTokenFunction · 0.85
writeMagicMessageFunction · 0.85
ResolveOutboundOwnerMethod · 0.80

Tested by

no test coverage detected