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.3] Allow Router::auth() to omit registration routes #16961

Conversation

shadoWalker89
Copy link
Contributor

I work on custom, private applications that do not allow outsiders to register accounts.
Accounts are added by an admin.

This will allow to omit defining those routes which is better then copying and pasting the auth() routes to routes file.

@ntzm
Copy link
Contributor

ntzm commented Dec 24, 2016

You can just add the routes manually without the register routes.

@shadoWalker89
Copy link
Contributor Author

@ntzm you can just read the description and see that i talked about that, and that is the reason behind the pull request

@taylorotwell
Copy link
Member

Indeed copy the routes you need and paste them into your routes file. This method will never accept any options, etc.

@shadoWalker89 shadoWalker89 deleted the auth_routes_without_registration branch December 24, 2016 17:31
@MarceauKa
Copy link

Just idea.

Why not:

public function auth()
{
    $this->authLogin();
    $this->authPassword();
    $this->authRegister();
}

public function authLogin()
{
    // Authentication Routes...
    $this->get('login', 'Auth\LoginController@showLoginForm')->name('login');
    $this->post('login', 'Auth\LoginController@login');
    $this->post('logout', 'Auth\LoginController@logout')->name('logout');
}

public function authPassword()
{
    // Registration
    $this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
    $this->post('register', 'Auth\RegisterController@register');
}

public function authRegister()
{
    // Password Reset Routes...
    $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm');
    $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
    $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
    $this->post('password/reset', 'Auth\ResetPasswordController@reset');
}

No parameters, no backward incompatibility. But i admit it, copy/paste routes from this method is not too difficult ;p

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

Successfully merging this pull request may close these issues.

4 participants