1
0
forked from baron/baron-sso

fix(dev): persist trusted rp secret after update

- store client_secret after trusted RP update responses
- add regression test for secret recovery on later detail fetch
This commit is contained in:
Lectom C Han
2026-03-30 21:13:22 +09:00
parent 34dba6689c
commit 45dfaf5905
2 changed files with 230 additions and 0 deletions

View File

@@ -1085,6 +1085,15 @@ func (h *DevHandler) UpdateClient(c *fiber.Ctx) error {
return errorJSON(c, fiber.StatusInternalServerError, err.Error())
}
if updatedClient.ClientSecret != "" {
if h.SecretRepo != nil {
_ = h.SecretRepo.Upsert(c.Context(), updatedClient.ClientID, updatedClient.ClientSecret)
}
if h.Redis != nil {
_ = h.Redis.Set("client_secret:"+updatedClient.ClientID, updatedClient.ClientSecret, 0)
}
}
summary := h.mapClientSummary(*updatedClient)
return c.JSON(clientDetailResponse{
Client: summary,