Skip to content

Commit 3eb9a43

Browse files
authored
fix: use query to get external-auth by id (#10156)
1 parent a61f8ee commit 3eb9a43

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

coderd/workspaceagents.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -2177,13 +2177,14 @@ func (api *API) postWorkspaceAppHealth(rw http.ResponseWriter, r *http.Request)
21772177
// @Router /workspaceagents/me/external-auth [get]
21782178
func (api *API) workspaceAgentsExternalAuth(rw http.ResponseWriter, r *http.Request) {
21792179
ctx := r.Context()
2180+
query := r.URL.Query()
21802181
// Either match or configID must be provided!
2181-
match := r.URL.Query().Get("match")
2182+
match := query.Get("match")
21822183
if match == "" {
21832184
// Support legacy agents!
2184-
match = r.URL.Query().Get("url")
2185+
match = query.Get("url")
21852186
}
2186-
id := chi.URLParam(r, "id")
2187+
id := query.Get("id")
21872188
if match == "" && id == "" {
21882189
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
21892190
Message: "'url' or 'id' must be provided!",

0 commit comments

Comments
 (0)