Skip to content

Commit 7be8801

Browse files
committed
fix merged claims
1 parent f9a637d commit 7be8801

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

coderd/database/dbauthz/dbauthz_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,7 @@ func (s *MethodTestSuite) TestUser() {
10221022
OAuthExpiry: link.OAuthExpiry,
10231023
UserID: link.UserID,
10241024
LoginType: link.LoginType,
1025+
DebugContext: json.RawMessage("{}"),
10251026
}).Asserts(link, rbac.ActionUpdate).Returns(link)
10261027
}))
10271028
s.Run("UpdateUserRoles", s.Subtest(func(db database.Store, check *expects) {

coderd/userauth.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,8 @@ func (api *API) userOIDC(rw http.ResponseWriter, r *http.Request) {
800800
// UserInfo endpoint, so we allow users to disable it and only rely on the
801801
// ID token.
802802
userInfoClaims := make(map[string]interface{})
803-
mergedClaims := make(map[string]interface{})
803+
// If user info is skipped, the idtokenClaims are the claims.
804+
mergedClaims := idtokenClaims
804805
if !api.OIDCConfig.IgnoreUserInfo {
805806
userInfo, err := api.OIDCConfig.Provider.UserInfo(ctx, oauth2.StaticTokenSource(state.Token))
806807
if err == nil {

0 commit comments

Comments
 (0)