diff --git a/app/src/recoil/auth.js b/app/src/recoil/auth.js index d17a802a3..21c1c7d7e 100644 --- a/app/src/recoil/auth.js +++ b/app/src/recoil/auth.js @@ -4,7 +4,15 @@ import { atom } from 'recoil'; export const userState = atom({ key: 'userState', default: null, - effects: [({ onSet }) => onSet((user) => Sentry.setUser(user))], + effects: [ + ({ onSet }) => + onSet((user) => + Sentry.setUser({ + id: user?._id, + email: user?.email, + }) + ), + ], }); export const organisationState = atom({ @@ -26,5 +34,5 @@ export const usersState = atom({ export const currentTeamState = atom({ key: 'currentTeamState', default: null, - effects: [({ onSet }) => onSet((currentTeam) => Sentry.setContext('currentTeam', currentTeam))], + effects: [({ onSet }) => onSet((currentTeam) => Sentry.setTag('currentTeam', currentTeam?._id ?? ''))], }); diff --git a/dashboard/src/recoil/auth.ts b/dashboard/src/recoil/auth.ts index 4da7ef96f..adffc6e89 100644 --- a/dashboard/src/recoil/auth.ts +++ b/dashboard/src/recoil/auth.ts @@ -7,7 +7,15 @@ import type { TeamInstance } from '../types/team'; export const userState = atom({ key: 'userState', default: null, - effects: [({ onSet }) => onSet((user) => AppSentry.setUser(user))], + effects: [ + ({ onSet }) => + onSet((user) => + AppSentry.setUser({ + id: user?._id, + email: user?.email, + }) + ), + ], }); export const userAuthentifiedState = selector({ @@ -52,6 +60,7 @@ export const usersState = atom({ export const currentTeamState = atom({ key: 'currentTeamState', default: null, + effects: [({ onSet }) => onSet((currentTeam) => AppSentry.setTag('currentTeam', currentTeam?._id ?? ''))], }); export const currentTeamAuthentifiedState = selector({