forked from baron/baron-sso
tenant 삭제 시 RP 허용 테넌트 정리 및 재유입 방지
This commit is contained in:
@@ -662,26 +662,7 @@ func tenantAccessPolicyChanged(before, after map[string]any) bool {
|
||||
}
|
||||
|
||||
func (h *DevHandler) revokeClientConsentsForPolicyChange(ctx context.Context, clientID string) error {
|
||||
if h.ConsentRepo == nil || h.Hydra == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
subjects, err := h.ConsentRepo.ListSubjectsByClient(ctx, clientID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, subject := range subjects {
|
||||
subject = strings.TrimSpace(subject)
|
||||
if subject == "" {
|
||||
continue
|
||||
}
|
||||
if err := h.Hydra.RevokeConsentSessions(ctx, subject, clientID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return h.ConsentRepo.DeleteByClient(ctx, clientID)
|
||||
return revokeClientConsentsForPolicyChange(ctx, h.Hydra, h.ConsentRepo, clientID)
|
||||
}
|
||||
|
||||
func isProtectedSystemClient(client domain.HydraClient) bool {
|
||||
|
||||
Reference in New Issue
Block a user