Skip to content

Commit 0a95ba6

Browse files
authored
chore: Deprecate old cookie value (#4336)
Older clis will need to be updated. Modern clis cannot communicate with <8.15 coderd
1 parent 4f63555 commit 0a95ba6

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

coderd/httpmw/apikey.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,14 +380,6 @@ func apiTokenFromRequest(r *http.Request) string {
380380
return cookie.Value
381381
}
382382

383-
// TODO: @emyrk in October 2022, remove this oldCookie check.
384-
// This is just to support the old cli for 1 release. Then everyone
385-
// must update.
386-
oldCookie, err := r.Cookie("session_token")
387-
if err == nil && oldCookie.Value != "" {
388-
return oldCookie.Value
389-
}
390-
391383
urlValue := r.URL.Query().Get(codersdk.SessionTokenKey)
392384
if urlValue != "" {
393385
return urlValue

codersdk/client.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ func (c *Client) Request(ctx context.Context, method, path string, body interfac
8383
}
8484
req.Header.Set(SessionCustomHeader, c.SessionToken)
8585

86-
// Delete this custom cookie set in November 2022. This is just to remain
87-
// backwards compatible with older versions of Coder.
88-
req.AddCookie(&http.Cookie{
89-
Name: "session_token",
90-
Value: c.SessionToken,
91-
})
92-
9386
if body != nil {
9487
req.Header.Set("Content-Type", "application/json")
9588
}

0 commit comments

Comments
 (0)