-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use in other projects? #25
Comments
@Danwhy firstly thank you for proactively opening this issue As described in the diagram and accompanying text in dwyl/technology-stack#67 Yes, the plan is to namespace all controllers under If you are heading in the Umbrella App direction, then you are on the "right track". ✅ We need a separate issue for how we are going to require the
I am very grateful that you made the effort to update the PR: #9 to Phoenix 1.4 Specifically the "foundational" module
@SimonLab has made a start with documenting But we will need to re-work some of the "internals" of With that in mind, I need your help with the following issue: dwyl/cid#11 Once the
Please continue to open/ask questions like this one. AnswerRe-read the Programming Phoenix 1.4 Book and see how Auth is done in the book. |
GOTO: #42 |
@nelsonic
What we've got so far is a working implementation of auth in an example app, but how should we go about using it in other projects?
Is the intention to keep the code in the form it is now when requiring it into other apps? By this I mean the logic being performed in the
controllers
so that all the parent application has to do is forward all requests to/auth
endpoints to this application, rather than the alternative which, would just be exposing the functions in this app and the parent module calling these functions to perform authorisation.You mentioned in dwyl/technology-stack#67 (comment) that Auth should eventually be its own, separately hosted umbrella app, so to me this does seem like a step towards that.
I have managed to get this method of integrating the apps working, but just wanted to check I wasn't heading in the wrong direction.
The main issue I had in getting this approach to work was the configuration. Dependency config files are not included when they are required as a dependency, as it is expected that the calling module will provide the config.
This was a problem as the Ueberauth plug that is being used in the
auth_controller
expects some configuration to be set before it is compiled, so an error was being thrown. My solution to overcome this was to useApplication.put_env
to set the config before the plug is called. This way we can set the config we want to specify inAuth
, and also read from the parent app's config file (withApplication.get_env
), allowing certain configurations to be set.The text was updated successfully, but these errors were encountered: