Add user context to Sentry

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-04-20 15:07:57 +02:00
parent 118175db3e
commit 6668a663a7
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -23,7 +23,8 @@ defmodule Mobilizon.Web.Auth.Context do
context = context =
case Guardian.Plug.current_resource(conn) do 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) Map.put(context, :current_user, user)
nil -> nil ->