Skip to content

Commit c909caa

Browse files
authored
Merge pull request #157 from ModelRocket/fix/middleware-context
Fixing issue where context modifications in authenticators are ignored
2 parents 9a7d474 + a983056 commit c909caa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

middleware/context.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,8 @@ func (c *Context) Authorize(request *http.Request, route *MatchedRoute) (interfa
433433
}
434434
}
435435

436+
rCtx = request.Context()
437+
436438
rCtx = stdContext.WithValue(rCtx, ctxSecurityPrincipal, usr)
437439
rCtx = stdContext.WithValue(rCtx, ctxSecurityScopes, route.Authenticator.AllScopes())
438440
return usr, request.WithContext(rCtx), nil

0 commit comments

Comments
 (0)