Comments (6)
Thanks for raising the issue. At the moment, I want to keep it as it is, and I'll outline why below.
- The generators are really designed to be used when starting an app, and several assumptions are made based on the fact that it is a new app. Designing them so that it is easier to install them at any time would add a layer of complexity that I do not see the need for. I also do not really have the time to spend doing this.
- There is an example app here, which developers can use to help them create the necessary files by hand.
In your case, it might just be a matter of generating the files using the mix openmaize.gen.phoenixauth
, not overwriting the web/router.ex
file and then editing web/router.ex
by hand.
I'm closing this issue for now, but if you have any further comments, please let me know.
from openmaize.
The generators are really designed to be used when starting an app
So far OpenMaize has really no major competitor in becoming the Devise equivalent of Phoenix applications. However, not upgrading the generators in order to make them fit a scenario where you would add them to an existing app seems to me a bad idea that will render OpenMaize, at most, a package used for school/college homework projects, certainly not for real world apps and not even for hackathons. Even at hackathons it's generally recommended to build the app's main functionality first before adding authentications and not the other way around.
I think your decisions will only limit the scope of the package usage on the long run. I don't want to be rude but these are my opinions on the decision.
from openmaize.
Maybe it might be implemented a simple switch to the generator, for example --write-addenda
that generates a file with just the addenda that we have to manually add to the already existent file(s). For example mix openmaize.gen.phoenixauth --write-addenda
would produce a file addenda.router.ex
(instead of the standard router.ex
) with this kind of hints inside:
# put the following line(s) in your `pipeline :browser do` block of your `router.ex` file:
plug Openmaize.Authenticate
# put the following line(s) in your ` scope "/", MyApp do` block after the `pipe_through :` line of your `router.ex` file:
get "/", PageController, :index
resources "/users", UserController
resources "/sessions", SessionController, only: [:new, :create, :delete]
get "/sessions/confirm_email", SessionController, :confirm_email
resources "/password_resets", PasswordResetController, only: [:new, :create, :edit, :update]
from openmaize.
Yes, that might be a simpler solution.
I'll look into it further and get back to you.
from openmaize.
I'm happy to work on @guidotripaldi's solution -- creating an addenda.router.ex
file that can then be copied into the web/router.ex
file.
The only question then is what to do with the user* files if they already exist in a project. Should we overwrite them?
@miskolc, what do you think?
from openmaize.
I'm closing this in favor of improving the documentation in the wiki.
from openmaize.
Related Issues (20)
- Newbie question: How would you proceed on verifying the confirmation link? HOT 1
- Move mix phoenixauth generator to a separate installer, out of the hex package HOT 1
- Installer cannot find templates HOT 4
- Facebook, Twitter, ect... Oauth into Openmaize? HOT 3
- Add logging to login and email confirmation modules HOT 3
- Installer Generates API template for HTML site. HOT 2
- Remove the unique_id argument for the installer HOT 1
- Prevent sensitive information being sent on from Openmaize modules
- Installer not working HOT 2
- Password reset can't handle non existing email address HOT 4
- Provide two-factor authentication workflow guide HOT 2
- Support for Phoenix 1.3.0 file and directory structure conventions HOT 7
- Move repo and user_model values to the config HOT 3
- Disable confirmation HOT 2
- create both api auth for api's & session auth for html site HOT 7
- Remove hash_name and crypto_mod config values
- Spring cleaning / reorganization -- discussion HOT 5
- How to translate short password validation? HOT 1
- add_confirm_token is missing on develop HOT 4
- Is this going to be deprecated? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openmaize.