Documentation
¶
Overview ¶
Package sentinel holds the error class every plane's ErrInvalidToken belongs to.
A plane's ErrInvalidToken has to stay its own value, so that errors.Is(err, user.ErrInvalidToken) keeps meaning exactly what it always did, and keep its own message. It also has to match authithttp.ErrInvalidToken, so that a host handing it to authithttp.StatusFor gets a 401 rather than a 500. errors.New gives the first and fmt.Errorf("%w") changes the message; New gives both.
The class lives here rather than in authithttp so that the planes can join it without importing net/http: pat, emaillogin and the rest have no notion of HTTP, and should not acquire one for the sake of an error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var InvalidToken = errors.New("authit/http: invalid bearer token")
InvalidToken is the class. authithttp exports this exact value as ErrInvalidToken, which is why its message names that package.
Functions ¶
Types ¶
This section is empty.