Skip to content
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

Commands for register and login #93

Closed
fiher opened this issue Dec 10, 2017 · 4 comments
Closed

Commands for register and login #93

fiher opened this issue Dec 10, 2017 · 4 comments
Labels
Feature New Feature

Comments

@fiher
Copy link

fiher commented Dec 10, 2017

Hello, I have opened this issue on the main symfony repository and I was told to do it on this one. Here is the main issue if you want to read it - symfony/symfony#25406 (comment)

Here is the idea - a command to create register and login form by providing an entity which implements UserInterface (I have seen that some think that this is a bad practice so if you really dislike UserInterface that much we can think of another requirement) and has some base options.

The command will generate SecurityController if it doesnt exist as well as login and register forms and views. It will change the route.yml and security.yml files to basically make everything needed for a login and register to work properly.

This way the user doesn't need to repeat everything mentioned in the documentation or download FOSUserBundle and then follow the documentation again. It saves a lot of time for people like me who make lots of demo projects to try new stuff (expecially after 4.0 is out).

If this command generates everything needed there is no need for any kind of magic. currently if you follow the documentation for register and login or if you download FOSUserBundle there is a lot of magic going on and you don't see the code (unless you dig into vendor folder a lot).

With that command the code generated can be dependency free (everything used by it is generated by it) and with no magic involved so that if a new user wants to use it and understand how it works he can do so very easily without having to write anything.

The command might be separated into two commands

  • make:security:register
    - -algorithm={algorithm name} (default is bcrypt)
    - --withsalt determines if the user wants the encryption to use salt( default is yes)
    - -entity={entity name} (default looks for User)
    - -path={path for register} (default is /register)

  • make:security:login if possible to use the options provided to make:security:register if not - repeat the same options
    - checkpath={path for check} (default is /login)
    - loginpath={path for login} (default is /login)

As you can see the two commands are under make:security which might have other commands.

I would love to participate in the development of these commands or anything to help Symfony, but I have never been part of such big repository so I would love it if there is someone willing to help me and answer my questions as I try to contribute to Symfony! If there is none - hope you guys will like the idea so that I can use it!

@uikolas
Copy link

uikolas commented Jan 2, 2018

#42
#76

Also one user is already doing something: #41 but it looks, he abandoned it. So I think you can create own pull request :)

@javiereguiluz javiereguiluz added the Feature New Feature label Jan 24, 2018
@ro0NL
Copy link
Contributor

ro0NL commented Apr 4, 2018

@fiher see https://medium.com/@ro0NL/adding-user-management-to-your-symfony-application-ceeefe2a2e9 also :)

@weaverryan
Copy link
Member

This has been done for awhile - just missed closing this issue!

@fiher
Copy link
Author

fiher commented May 21, 2019

Nice, @weaverryan mind telling me in which update it got introduced as this proposal was quite a while ago?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature
Projects
None yet
Development

No branches or pull requests

5 participants