Closed robertmarney closed 8 months ago
Closes #1704
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.
make
Laravel\Passport\Exceptions\AuthenticationException
redirectTo
throw new AuthenticationException
throw AuthenticationException::make()
Catch the exception in your application's exception handler's render method and return the redirect from there.
render
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:
make
function on the existingLaravel\Passport\Exceptions\AuthenticationException
and use the existingredirectTo
argument.throw new AuthenticationException
withthrow AuthenticationException::make()