britton-jb / sentinel

DEPRECATED - Phoenix Authentication library that wraps Guardian for extra functionality
MIT License
106 stars 19 forks source link

Add ability to generate and copy views and templates into the application #39

Closed trestrantham closed 7 years ago

trestrantham commented 7 years ago

I had a need to customize the default registration views (by adding additional user fields) and needed a way to copy the views/templates into my application as a result.

This copies sentinel views and templates into the application for a given context using mix sentinel.gen.views user. Available values are "email", "error", "password", "session", "shared", and "user". To support this, all views have been parameterized and added to Config.views. Once a given view (and templates) has been copied to the application, the view must be specified in config.exs using the views key:

config :sentinel,
  views: %{user: MyApp.Web.UserView}
trestrantham commented 7 years ago

Just pushed a commit to make these generators compatible with phoenix <= 1.2 🕺

rrevanth commented 7 years ago

I tested this branch in my pheonix 1.2 application and it's working as expected.

I just updated the views config in my application to corresponding modules.

trestrantham commented 7 years ago

Fixed a bug with the password view generation and updated README (hat tip to @rrevanth). I don't have anything else pending here, so let me know if you catch anything @britton-jb. 🕵️

britton-jb commented 7 years ago

I'll take some time to review this (and the other PRs) one more time tonight, but I really appreciate the work you've done, and @rrevanth for testing.

trestrantham commented 7 years ago

Updated this with latest master 👍

britton-jb commented 7 years ago

Sorry this one is taking me longer to get to, but thanks again for all of the other work you've done so far.

trestrantham commented 7 years ago

No worries! I working with this locally so no rush on my end.

trestrantham commented 7 years ago

Is there anything I can do to help this get merged?

britton-jb commented 7 years ago

This one is actually good, and upon reflection I should have just merged it in already. I just have bit more I want to do on my side before I release a new version of Sentinel to Hex with these breaking API changes.

Sorry about the delays.

trestrantham commented 7 years ago

No worries. Let me know if there's anything I can help with whether it be this PR or elsewhere. 🙌