Skip to content

Commit e78c272

Browse files
authored
chore: System context to oidc login (#6427)
1 parent 02f0968 commit e78c272

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

coderd/userauth.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ func (api *API) userAuthMethods(rw http.ResponseWriter, r *http.Request) {
304304
// @Router /users/oauth2/github/callback [get]
305305
func (api *API) userOAuth2Github(rw http.ResponseWriter, r *http.Request) {
306306
var (
307-
ctx = r.Context()
307+
// userOAuth2Github is a system function.
308+
//nolint:gocritic
309+
ctx = dbauthz.AsSystemRestricted(r.Context())
308310
state = httpmw.OAuth2(r)
309311
auditor = api.Auditor.Load()
310312
aReq, commitAudit = audit.InitRequest[database.APIKey](rw, &audit.RequestParams{
@@ -489,7 +491,9 @@ type OIDCConfig struct {
489491
// @Router /users/oidc/callback [get]
490492
func (api *API) userOIDC(rw http.ResponseWriter, r *http.Request) {
491493
var (
492-
ctx = r.Context()
494+
// userOIDC is a system function.
495+
//nolint:gocritic
496+
ctx = dbauthz.AsSystemRestricted(r.Context())
493497
state = httpmw.OAuth2(r)
494498
auditor = api.Auditor.Load()
495499
aReq, commitAudit = audit.InitRequest[database.APIKey](rw, &audit.RequestParams{

0 commit comments

Comments
 (0)