Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

498 B
Raw Blame
import type { Context } from "hono";
import { readClientIp } from "../../utils/client-ip";

/** Who performed an admin action, and from where. */
export type AdminAuditRequest = {
  actorUserId: string | null;
  ipAddress: string | null;
  userAgent: string | null;
};

export function adminAuditRequest(c: Context): AdminAuditRequest {
  return {
    actorUserId: c.get("user")?.id ?? null,
    ipAddress: readClientIp(c.req.raw.headers),
    userAgent: c.req.header("user-agent") ?? null,
  };
}