Frank 2 månader sedan
förälder
incheckning
64d67f2134
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4 0
      packages/console/app/src/routes/zen/util/handler.ts

+ 4 - 0
packages/console/app/src/routes/zen/util/handler.ts

@@ -170,6 +170,10 @@ export async function handler(
                     if (v === "$ip") return [[k, ip]]
                     if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo?.workspaceID]] : []
                     if (v === "$session") return sessionId ? [[k, sessionId]] : []
+                    if (v === "$user") {
+                      const user = sessionId ?? authInfo?.workspaceID ?? ip
+                      return user ? [[k, user]] : []
+                    }
                     if (v.startsWith("$header.")) {
                       const headerValue = input.request.headers.get(v.slice(8))
                       return headerValue ? [[k, headerValue]] : []