You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently followed the How to use Pow in an API, and overall the experience was great. The very first paragraph of this document is the following:
Pow comes with plug n' play support for Phoenix as HTML web interface. API's work differently, and the developer should have full control over the flow in a proper built API. Therefore Pow encourages that you build custom controllers, and use the plug methods for API integration.
Overall, I very much agree with this philosophy. I was able to tweak the Pow API implementation to suit my application, and the process was very painless.
However, one thing in this approach stood out to me: the APIAuthPlug. I copied this module into my app verbatim, and other than changing MyAppWeb, there wasn't anything in this file specific to my application. Maybe I haven't experienced the full use cases of modifying this file so far, but I'm struggling to see what I would want to modify in this file.
I personally feel like this module should be moved into Pow. I think there are a few benefits of doing so:
Keeping this module in Pow helps to maintain the abstractions that Pow provides. Modifying this file seems to require a specific understanding of how Pow works, which I don't think many users of Pow would have (myself included).
If the file were moved into Pow, it could be thoroughly tested like the rest of the Pow codebase.
If there's ever a need to modify this file in the future, it could be done without any issues with existing applications.
If anyone ever did need to modify the behavior of this file, they could copy it into their application and make the modifications.
If you're open to this change, I'd be happy to do the legwork of getting it into the repo and updating the api.md document.
Thanks!
The text was updated successfully, but these errors were encountered:
I've recently followed the How to use Pow in an API, and overall the experience was great. The very first paragraph of this document is the following:
Overall, I very much agree with this philosophy. I was able to tweak the Pow API implementation to suit my application, and the process was very painless.
However, one thing in this approach stood out to me: the
APIAuthPlug
. I copied this module into my app verbatim, and other than changingMyAppWeb
, there wasn't anything in this file specific to my application. Maybe I haven't experienced the full use cases of modifying this file so far, but I'm struggling to see what I would want to modify in this file.I personally feel like this module should be moved into Pow. I think there are a few benefits of doing so:
If anyone ever did need to modify the behavior of this file, they could copy it into their application and make the modifications.
If you're open to this change, I'd be happy to do the legwork of getting it into the repo and updating the api.md document.
Thanks!
The text was updated successfully, but these errors were encountered: