Include sentry username

This commit is contained in:
Patrick Fic
2021-08-11 11:16:22 -07:00
parent fe5f4f2727
commit 18618efdc0

View File

@@ -28,6 +28,7 @@ import {
validatePasswordResetSuccess,
} from "./user.actions";
import UserActionTypes from "./user.types";
import * as Sentry from "@sentry/browser";
export function* onEmailSignInStart() {
yield takeLatest(UserActionTypes.EMAIL_SIGN_IN_START, signInWithEmail);
@@ -178,6 +179,11 @@ export function* signInSuccessSaga({ payload }) {
]);
console.log("Setting $crisp segments", ["user"]);
window.$crisp.push(["set", "session:segments", [["user"]]]);
Sentry.setUser({
email: payload.email,
username: payload.displayName || payload.email,
});
} catch (error) {
console.log("Error updating Crisp settings.", error);
}