adonisjs / v5-docs

📚 Source code and documentation for the official docs website.
https://v5-docs.adonisjs.com
88 stars 138 forks source link

Replaced `badRequest` with `unauthorized` in api-tokens-guard.md #160

Closed arnonrdp closed 2 years ago

arnonrdp commented 2 years ago

I replaced badRequest with unauthorized.

According to w3.org:

10.4.1 400 Bad Request The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

10.4.2 401 Unauthorized The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information. HTTP access authentication is explained in "HTTP Authentication: Basic and Digest Access Authentication" [43].

RomainLanz commented 2 years ago

Thanks!