Add user tagging for logged-in staff users

This commit is contained in:
2026-03-12 02:20:16 -04:00
parent 97d84bdc17
commit f5e2110ff4
4 changed files with 70 additions and 4 deletions

View File

@@ -27,7 +27,11 @@ import Navigation from "../components/Navigation.js";
import { type ReactNode, StrictMode, useContext, useEffect } from "react";
import theme from "../theme.js";
import { withEmotionCache } from "@emotion/react";
import { captureRemixErrorBoundaryError, withSentry } from "@sentry/remix";
import {
captureRemixErrorBoundaryError,
setUser,
withSentry,
} from "@sentry/remix";
export function ErrorBoundary() {
const error = useRouteError() as ErrorResponse;
@@ -226,6 +230,18 @@ function DocumentWrapper(props: {
function App() {
const loaderData = useLoaderData<typeof loader>();
if (
loaderData.id &&
[0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].find(
(p) => loaderData.permissions & (1 << p),
)
)
setUser({
email: loaderData.email,
id: loaderData.id,
username: loaderData.username,
});
return (
<DocumentWrapper loaderData={loaderData}>
<Outlet />