From 6668a663a78511bb459676ead6b70709d686721d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 20 Apr 2021 15:07:57 +0200 Subject: [PATCH] Add user context to Sentry Signed-off-by: Thomas Citharel --- lib/web/auth/context.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/web/auth/context.ex b/lib/web/auth/context.ex index 9f41dd61f..aaa16e25a 100644 --- a/lib/web/auth/context.ex +++ b/lib/web/auth/context.ex @@ -23,7 +23,8 @@ defmodule Mobilizon.Web.Auth.Context do context = case Guardian.Plug.current_resource(conn) do - %User{} = user -> + %User{id: user_id, email: user_email} = user -> + Sentry.Context.set_user_context(%{id: user_id, name: user_email}) Map.put(context, :current_user, user) nil ->