I have the issue to pass auth exceptions to the js-events.
By the default if I need to develope the custom logic for the auth validation, I go to FortifyServiceProvider and in the boot function call the Fortify::authenticateUsing method and
return $user;
if success or
throw ValidationException::withMessages(['login' => $isMessage ? $e->getMessage() : 'Server error']);
if fail.
The problem in the way of the returning exception. ValidationException::withMessages returns the exception to the validate html-element under some field. For example, login.
But my issue to return the exception to js-event, for example to toastr.
If you have questions, why do I need this way. Because I exlude authorization using login and password to make request to separate database.
Please, help to solve.