mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: use query to get external-auth by id (#10156)
This commit is contained in:
@@ -2177,13 +2177,14 @@ func (api *API) postWorkspaceAppHealth(rw http.ResponseWriter, r *http.Request)
|
||||
// @Router /workspaceagents/me/external-auth [get]
|
||||
func (api *API) workspaceAgentsExternalAuth(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
query := r.URL.Query()
|
||||
// Either match or configID must be provided!
|
||||
match := r.URL.Query().Get("match")
|
||||
match := query.Get("match")
|
||||
if match == "" {
|
||||
// Support legacy agents!
|
||||
match = r.URL.Query().Get("url")
|
||||
match = query.Get("url")
|
||||
}
|
||||
id := chi.URLParam(r, "id")
|
||||
id := query.Get("id")
|
||||
if match == "" && id == "" {
|
||||
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
|
||||
Message: "'url' or 'id' must be provided!",
|
||||
|
||||
Reference in New Issue
Block a user