I am trying to implement Canary into my application, and I have come across a problem. The docs (https://github.com/cpjk/canary#overriding-the-default-user) say that I need to have an Ecto record for the current user in conn.assigns.current_user. Since I am using Guardian, my current user is stored in Guardian.Plug.current_resource(conn). What is the best way to let canary know that this is where I store my current user?
I can't use the config :canary, current_user: :my_user_key because it isn't even in conn.assigns.
Help is appreciated!
Following this article, you should create a Plug for that:
and put it in a router pipeline: