You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logging in is the only auth route that doesn't use the API.
Signing up is /register, which uses /api/users in the background
Forgot password is /api/forgot
By default, the LogInValidator doesn't have any rules. This is on purpose, so that it can be extended. However, if you have failing rules there, the ValidationExceptionHandler won't return JSON since this is not an API route. Instead, it'll return a 422 with the exception stack trace (in debug mode):
POST /login
Illuminate\Validation\ValidationException: The given data was invalid. in file ./vendor/flarum/core/src/Foundation/AbstractValidator.php on line 64
Stack trace:
1.Illuminate\Validation\ValidationException->() ./vendor/flarum/core/src/Foundation/AbstractValidator.php:642.Flarum\Foundation\AbstractValidator->assertValid() .vendor/flarum/core/src/Forum/Controller/LogInController.php:83
Steps to Reproduce
Add a rule to LogInValidator (e.g. enable login recaptcha with fof/recaptcha)
Fail the validation rules (e.g. make request to /login without g-recaptcha-response)
View 422 with no JSON response
Expected Behavior
The route should return JSON on a validation exception
Current Behavior
Logging in is the only auth route that doesn't use the API.
/register
, which uses/api/users
in the background/api/forgot
By default, the LogInValidator doesn't have any rules. This is on purpose, so that it can be extended. However, if you have failing rules there, the
ValidationExceptionHandler
won't return JSON since this is not an API route. Instead, it'll return a 422 with the exception stack trace (in debug mode):Steps to Reproduce
LogInValidator
(e.g. enable login recaptcha withfof/recaptcha
)/login
withoutg-recaptcha-response
)Expected Behavior
The route should return JSON on a validation exception
Screenshots
reCAPTCHA failure:
Authentication failure:
Environment
Output of
php flarum info
No response
Possible Solution
No response
Additional Context
See FriendsOfFlarum/recaptcha#39 and https://discuss.flarum.org/d/18399-friendsofflarum-recaptcha/173
The text was updated successfully, but these errors were encountered: