Skip to content

Commit

Permalink
Fix browser not popping up the basic auth login modal (#1986)
Browse files Browse the repository at this point in the history
When dashboard basic auth was enabled and user not authenticated,
the echo server return a HTTP 500 response. The root cause
was that in the error handling, the error was already leaf error,
but it get unwrapped to nil get handled as internal server error.

Use the unwrapAll() which returns the leaf node always, and error
get handled properly.
  • Loading branch information
ernoaapa authored Jan 25, 2022
1 parent 90d1419 commit d87086c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/dashboard/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func setupRoutes(e *echo.Echo) {
var statusCode int
var message string

switch errors.Unwrap(err) {
switch errors.UnwrapAll(err) {
case echo.ErrNotFound:
c.Redirect(http.StatusSeeOther, "/")
return
Expand Down

0 comments on commit d87086c

Please sign in to comment.