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

[5.7] Ability to disable register route #25556

Merged
merged 1 commit into from Sep 10, 2018
Merged

[5.7] Ability to disable register route #25556

merged 1 commit into from Sep 10, 2018

Conversation

@Cannonb4ll
Copy link
Contributor

@Cannonb4ll Cannonb4ll commented Sep 10, 2018

Sometimes you will want to disable registering in a application, this PR makes it possible to easily disable those routes.

Auth::routes(['register' => false]);
@JeroenBoesten
Copy link
Contributor

@JeroenBoesten JeroenBoesten commented Sep 10, 2018

I feel this should've been added a long time ago, needed this more than once, and it seems like a viable option since email verification now works in the same way.

@taylorotwell taylorotwell merged commit aac6144 into laravel:5.7 Sep 10, 2018
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@GrahamCampbell GrahamCampbell changed the title Ability to disable register route [5.7] Ability to disable register route Sep 11, 2018
@sisve
Copy link
Contributor

@sisve sisve commented Sep 12, 2018

This sounds like something that should have tests. It sounds like a security problem if a dev sets up a site, disable registering, and we accidentally include the register routes again.

On a separate note, should the password reset also have this type of toggle?

@devcircus
Copy link
Contributor

@devcircus devcircus commented Sep 13, 2018

Never understood why you would hide routes behind a method anyway. Your routes file should be explicit. Quicker to do it manually than to use this new option, if you know how to use your editor.

@browner12
Copy link
Contributor

@browner12 browner12 commented Sep 13, 2018

yah, I personally would prefer we got rid of Auth::routes(), but I don't think that's happening anytime soon.

@yajra
Copy link
Contributor

@yajra yajra commented Sep 14, 2018

Thanks @Cannonb4ll, sent a related PR #19452 but failed. Glad this went through! Less codes with clean implementation at least for me. No more if to toggle register. :)

Auth::routes([
    'verify'   => true
    'register' => config('site.registration', true),
]);
@shadoWalker89
Copy link
Contributor

@shadoWalker89 shadoWalker89 commented Sep 26, 2018

@yajra yeah me too,
Done the same exact thing a long time ago #16961

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants