Skip to content

Commit d24cdc2

Browse files
authored
Merge pull request #25 from devtron-labs/image-promotion
feat: set user id and token in context
2 parents 9380678 + 91b032c commit d24cdc2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

middleware/AuthMiddleware.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ func Authorizer(sessionManager *SessionManager, whitelistChecker func(url string
8383
}
8484

8585
// setting user id in context
86-
context.WithValue(r.Context(), "userId", userId)
86+
ctx := context.WithValue(r.Context(), "userId", userId)
87+
ctx = context.WithValue(ctx, "token", token)
88+
r = r.WithContext(ctx)
8789
}
8890
}
8991
if pass {

0 commit comments

Comments
 (0)