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
Modify error message logic #94
Comments
Hi there, Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels: However, this issue will not be locked and everyone is still free to discuss solutions to your problem! Thanks. |
It'd be cool to get an answer? If there is a way, that's fine, I'll go seek help on StackOverflow -- Otherwise, it's a feature request. |
If there was a customisable action e.g:
that we could use in the same way as the other Actions, this would solve the problem, I think. Again, @driesvints, this is a Feature Request |
@JamesZXCVBNM if you want to change anything feel free to send in a pr |
For anyone else who stumbles on the same problem. This might help: if ($user && in_array($user->status_id, [1,2,3])) {
if (Hash::check($request->password, $user->password)) {
return $user;
}
}
else {
throw ValidationException::withMessages([
Fortify::username() => "Username not found or account is inactive. Please check your username.",
]);
} It'd be great if the documentation could be updated to include something like that as an example |
@JamesZXCVBNM if you want to add something feel free to PR it 👍 |
I'm trying to rebuild a specific authentication implementation we were using in Laravel 7 with Fortify, however, there doesn't seem to be a way to modify the authorisation error message returned to the user within the
Fortify::authenticateUsing()
method.For example:
I've traced this back to the
Laravel/Fortify/Actions/AttemptToAuthenticate
class and thethrowFailedAuthenicationException
function which allows you to customise the message via theresources\lang\en\auth.php
file, but there doesn't seem to be a way of modifying the logic of which message should be returned anywhere?If I'm wrong, could the documentation be updated to show how?
The text was updated successfully, but these errors were encountered: