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

[Feature] Allow configuration of login redirect route via config #1708

Closed
wants to merge 1 commit into from

Conversation

robertmarney
Copy link

Closes #1704

Description:

Allow developers to override the opinion of where unauthenticated users are redirected to for login.

This is particularly useful in cases where the application has multiple guards in place.

Implementation:

  1. Introduce new config property to store the custom login route.
  2. Introduce new make function on the existing Laravel\Passport\Exceptions\AuthenticationException and use the existing redirectTo argument.
  3. Replace all existing throw new AuthenticationException with throw AuthenticationException::make()
  4. Update existing tests with the requisite mocks
  5. Introduce new test for this explicit functionality

@taylorotwell
Copy link
Member

Catch the exception in your application's exception handler's render method and return the redirect from there.

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.

Allow for configuration of which login route to use
2 participants