schrockwell / bodyguard

Simple authorization conventions for Phoenix apps

Home Page:https://hexdocs.pm/bodyguard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix user option for Bodyguard.Plug.Authorize

schrockwell opened this issue · comments

Need to do something smarter about the user option in the Bodyguard.Plug.Authorize plug module. Since the init/1 callback happens at compile-time, we can't provide functions as options because they can't be unwrapped.

The easiest solution is change it to a {module, function} tuple that gets the current user from the conn.

Never mind - seems to work okay!