Skip to content

Commit

Permalink
Tech - Ajout de l'utilisateur dans Sentry (#3730)
Browse files Browse the repository at this point in the history
## Linked issues

- Ajout de l'utilisateur dans Sentry

----

- [ ] Tests E2E (Cypress)
  • Loading branch information
louptheron authored Oct 3, 2024
2 parents 099f30b + a61d6ce commit 96e51ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/auth/hooks/useCustomAuth.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useTracking } from '@hooks/useTracking'
import { setUser } from '@sentry/react'
import { useCallback, useEffect, useMemo, useState } from 'react'
import { hasAuthParams, useAuth, type AuthContextProps } from 'react-oidc-context'

Expand Down Expand Up @@ -27,7 +28,8 @@ export function useCustomAuth(): {

useEffect(() => {
if (auth?.user?.profile?.email) {
trackUserId(auth?.user?.profile?.email)
trackUserId(auth.user.profile.email)
setUser({ email: auth.user.profile.email })
}
}, [trackUserId, auth?.user?.profile?.email])

Expand Down

0 comments on commit 96e51ca

Please sign in to comment.