Skip to content

Commit 7499930

Browse files
authored
fix: change oauth convert oidc cookie to SameSite=Lax (#9129)
The strict mode was blocking the cookie from being sent on the redirect flow. This worked on localhost because cookies behave differently on localhost
1 parent b052935 commit 7499930

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

coderd/userauth.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ func (api *API) postConvertLoginType(rw http.ResponseWriter, r *http.Request) {
184184
Expires: claims.ExpiresAt.Time,
185185
Secure: api.SecureAuthCookie,
186186
HttpOnly: true,
187-
SameSite: http.SameSiteStrictMode,
187+
// Must be SameSite to work on the redirected auth flow from the
188+
// oauth provider.
189+
SameSite: http.SameSiteLaxMode,
188190
})
189191
httpapi.Write(ctx, rw, http.StatusCreated, codersdk.OAuthConversionResponse{
190192
StateString: stateString,

0 commit comments

Comments
 (0)