passport icon indicating copy to clipboard operation
passport copied to clipboard

Consider moving options out of configuration

Open chrismccord opened this issue 9 years ago • 2 comments

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 :)

chrismccord avatar Sep 29 '15 21:09 chrismccord

:+1:

scrogson avatar Oct 08 '15 02:10 scrogson

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!

allyraza avatar Jul 04 '16 01:07 allyraza