Giter VIP home page Giter VIP logo

Comments (6)

riverrun avatar riverrun commented on August 16, 2024

Thanks for raising the issue. At the moment, I want to keep it as it is, and I'll outline why below.

  1. 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.
  2. 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.

miskolc avatar miskolc commented on August 16, 2024

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.

guidotripaldi avatar guidotripaldi commented on August 16, 2024

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.

riverrun avatar riverrun commented on August 16, 2024

Yes, that might be a simpler solution.
I'll look into it further and get back to you.

from openmaize.

riverrun avatar riverrun commented on August 16, 2024

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.

riverrun avatar riverrun commented on August 16, 2024

I'm closing this in favor of improving the documentation in the wiki.

from openmaize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.