MCPcopy Index your code
hub / github.com/simstudioai/sim / setDeploymentAuthCookie

Function setDeploymentAuthCookie

apps/sim/lib/core/security/deployment.ts:92–109  ·  view source on GitHub ↗
(
  response: NextResponse,
  cookiePrefix: DeploymentAuthKind,
  deploymentId: string,
  authType: string,
  encryptedPassword?: string | null
)

Source from the content-addressed store, hash-verified

90 * Sets an authentication cookie for a deployment
91 */
92export function setDeploymentAuthCookie(
93 response: NextResponse,
94 cookiePrefix: DeploymentAuthKind,
95 deploymentId: string,
96 authType: string,
97 encryptedPassword?: string | null
98): void {
99 const token = generateAuthToken(deploymentId, authType, encryptedPassword)
100 response.cookies.set({
101 name: deploymentAuthCookieName(cookiePrefix, deploymentId),
102 value: token,
103 httpOnly: true,
104 secure: !isDev,
105 sameSite: 'lax',
106 path: '/',
107 maxAge: 60 * 60 * 24,
108 })
109}
110
111/**
112 * Checks if an email matches the allowed emails list (exact match or domain

Callers 3

route.tsFile · 0.90
route.tsFile · 0.90
setChatAuthCookieFunction · 0.90

Calls 3

generateAuthTokenFunction · 0.85
deploymentAuthCookieNameFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected