From bfb7620120d60ccf872b9eb5f97f7ec0cb97fe93 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Mon, 17 Feb 2020 13:22:31 +0200 Subject: [PATCH] Add user to Sentry context --- lib/plausible_web/auth_plug.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/plausible_web/auth_plug.ex b/lib/plausible_web/auth_plug.ex index 9261ea999..608993d36 100644 --- a/lib/plausible_web/auth_plug.ex +++ b/lib/plausible_web/auth_plug.ex @@ -13,6 +13,7 @@ defmodule PlausibleWeb.AuthPlug do user = Repo.get_by(Plausible.Auth.User, id: id) |> Repo.preload(:subscription) if user do + Sentry.Context.set_user_context(%{id: user.id, name: user.name}) assign(conn, :current_user, user) else conn