MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getLoginUrlOrigin

Function getLoginUrlOrigin

freebuff/web/src/app/api/auth/cli/code/_origin.ts:1–13  ·  view source on GitHub ↗
(
  req: Request,
  configuredAppUrl: string,
  fallbackOrigin: string,
  allowLocalhost: boolean,
)

Source from the content-addressed store, hash-verified

1export function getLoginUrlOrigin(
2 req: Request,
3 configuredAppUrl: string,
4 fallbackOrigin: string,
5 allowLocalhost: boolean,
6): string {
7 const configuredOrigin = getUsableOrigin(configuredAppUrl, allowLocalhost)
8 if (configuredOrigin) {
9 return configuredOrigin
10 }
11
12 return getUsableOrigin(req.url, allowLocalhost) ?? fallbackOrigin
13}
14
15function getUsableOrigin(url: string, allowLocalhost: boolean) {
16 try {

Callers 2

POSTFunction · 0.90
origin.test.tsFile · 0.90

Calls 1

getUsableOriginFunction · 0.70

Tested by

no test coverage detected