passport
passport copied to clipboard
Consider moving options out of configuration
I'm proposing the repo and user model be moved out of configuration and into plug options. The way things are now, the configuration is global where instead it could provided to the controller or auth plug as plug options and referenced off the connection instead. I would also recommend renaming user_class
to something more functional :)
:+1:
hi @chrismccord, @scrogson
I am implementing an auth library http://github.com/elixirdrops/carbon facing very issue how to swap out the repo, model an application could have many identities within e.g user,admin this is what I have so far
you have the global options but you can also configure auth plug with options like so
plug Carbon.Auth, [repo: MyApp.Repo, model: MyApp.UserModel]
plug Carbon.Auth, [repo: MyApp.Repo, model: MyApp.AdminModel]
any suggestions would be greatly appreciated
Thank you!