Chronicle.Phoenix.Plug (chronicle v0.1.2)

Copy Markdown

Adds request, actor, and correlation information to Chronicle.Context.

Add it after authentication if :actor_assign should resolve a user:

plug Chronicle.Phoenix.Plug,
  actor_assign: :current_user,
  actor_mapper: &MyApp.Chronicle.actor/1

Phoenix handles each request in its own process, so the context naturally ends with the request process.