Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
peturgeorgievv committed Aug 30, 2023
2 parents b93b695 + 9fff749 commit bdf9c0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 2 additions & 0 deletions econt-bg.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ local claims = std.extVar('claims');
name: claims.name,
access_token: claims.access_token,
expires_in: claims.expires_in,
setIds: ["c9149290-2549-4bdd-a9ba-c0e02b83938a", "6ecf0270-9350-46d8-aae5-59823a440180"],
provider: "econtbg",
},
},
}
1 change: 1 addition & 0 deletions econt.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local claims = std.extVar('claims');
name: claims.name,
access_token: claims.access_token,
expires_in: claims.expires_in,
provider: "econt",
},
},
}
18 changes: 0 additions & 18 deletions selfservice/strategy/oidc/strategy_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,24 +308,6 @@ func (s *Strategy) processRegistration(w http.ResponseWriter, r *http.Request, r
return nil, s.handleError(w, r, rf, provider.Config().ID, i.Traits, err)
}

var traits map[string]interface{}
if err := json.Unmarshal(i.Traits, &traits); err != nil {
return nil, s.handleError(w, r, rf, provider.Config().ID, nil, errors.WithStack(herodot.ErrInternalServerError.WithReason("The identity's traits could not be decoded properly").WithDebug(err.Error())))
}

traits["provider"] = provider.Config().ID // econt/econt-bg

newTraits, err := json.Marshal(traits)
if err != nil {
return nil, s.handleError(w, r, rf, provider.Config().ID, nil, errors.WithStack(herodot.ErrInternalServerError.WithReason("The updated traits could not be encoded properly").WithDebug(err.Error())))
}
i.Traits = newTraits

err = s.d.PrivilegedIdentityPool().UpdateIdentity(r.Context(), i)
if err != nil {
return nil, s.handleError(w, r, rf, provider.Config().ID, nil, errors.WithStack(herodot.ErrInternalServerError.WithReason("The identity's traits could not be updated").WithDebug(err.Error())))
}

return nil, nil
}

Expand Down

0 comments on commit bdf9c0b

Please sign in to comment.