Skip to content

Commit 26434a2

Browse files
committed
adding user context
1 parent 374d519 commit 26434a2

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

web-frontend/src/App.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,20 @@ import { useNavigate } from "react-router";
33
import { useAuth } from "./context/AuthContext";
44
import HeaderBar from "./components/HeaderBar";
55
import Landing from "./components/Landing";
6+
import { datadogRum } from '@datadog/browser-rum';
67
import "./App.css";
78

89
function App() {
9-
const { isAuthenticated, isLoading } = useAuth();
10+
const { isAuthenticated, isLoading, user } = useAuth();
1011
const navigate = useNavigate();
1112

13+
if (isAuthenticated) {
14+
datadogRum.setUser({
15+
name: user.preferred_username,
16+
email: user.email
17+
})
18+
}
19+
1220
useEffect(() => {
1321
if (!isLoading && isAuthenticated) {
1422
navigate("/dashboard");

0 commit comments

Comments
 (0)