Skip to content

Commit

Permalink
fix(server): stop emitting internal errors in responses
Browse files Browse the repository at this point in the history
  • Loading branch information
luizfonseca committed Nov 28, 2023
1 parent 3cd4e89 commit 4068739
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/app/traefik-github-oauth-server/router/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func OauthPageUrlHandler(app *server.App) http.HandlerFunc {

w.WriteHeader(http.StatusInternalServerError)
render.JSON(w, r, model.ResponseError{
Message: fmt.Sprintf("[server]%s: %s", err.Error(), app.Config.ApiBaseURL),
Message: "InternalServerError",
})
return
}
Expand Down Expand Up @@ -103,7 +103,7 @@ func OauthRedirectHandler(app *server.App) http.HandlerFunc {
Err(err).
Msg("failed to get GitHub user")
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
w.Write([]byte("InternalServerError"))
return
}

Expand All @@ -119,7 +119,7 @@ func OauthRedirectHandler(app *server.App) http.HandlerFunc {
Msg("invalid auth url")

w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(fmt.Errorf("%s:, %s", ErrInvalidAuthURL.Error(), authRequest.AuthURL).Error()))
w.Write([]byte("InternalServerError"))
return
}
authURLQuery := authURL.Query()
Expand Down

0 comments on commit 4068739

Please sign in to comment.