Closed tobz-nz closed 8 months ago
I found a pretty quick/easy solution for this:
// webauthn.js
async login(request = {}, response = {}) {
const optionsResponse = await this.#fetch(request, this.#routes.loginOptions);
const json = await optionsResponse.json();
+ if (optionsResponse.status > 400) {
+ json.status = optionsResponse.status;
+ throw json;
+ }
...
Could maybe be made a little tidier but does the trick. I guess adding the same thing to the register
method as well.
Yeah. Not a bug, because the response is received regardless of the code. Yep, you have to throw the error manually in Javascript.
PHP & Platform
8.2.2
Database
No response
Laravel version
10.13.5
Have you done this?
Expectation
On a login/register options request, if validation fails, errors should be availabe in the
catch(resposne => {})
method.Description
On a login/register options request, if validation fails, there is no way to display the specific errors to the user.
Reproduction
Stack trace & logs
No response