MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / draftAuth

Function draftAuth

packages/app/src/web/server-connection-menu.tsx:201–214  ·  view source on GitHub ↗
(draft: DraftProfile)

Source from the content-addressed store, hash-verified

199 });
200
201const draftAuth = (draft: DraftProfile): ExecutorServerAuth | undefined => {
202 const secret = draft.secret.trim();
203 if (draft.authMode === "bearer" && secret) {
204 return { kind: "bearer", token: secret };
205 }
206 if (draft.authMode === "basic" && secret) {
207 return {
208 kind: "basic",
209 username: draft.username.trim() || undefined,
210 password: secret,
211 };
212 }
213 return undefined;
214};
215
216interface ServerConnectionMenuProps {
217 readonly side?: "top" | "right" | "bottom" | "left";

Callers 1

addProfileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected