fix did validation in hold admin

This commit is contained in:
Evan Jarrett
2026-02-16 21:16:11 -06:00
parent 6b87539ef8
commit cd4986c0c8
2 changed files with 3 additions and 3 deletions

View File

@@ -88,8 +88,8 @@ func (ui *AdminUI) handleSettingsUpdate(w http.ResponseWriter, r *http.Request)
// Validate successor DID format if provided
if successor != "" {
if !atproto.IsDID(successor) || !strings.HasPrefix(successor, "did:web:") {
setFlash(w, r, "error", "Successor must be a valid did:web: DID (e.g., did:web:hold.example.com)")
if !atproto.IsDID(successor) || !(strings.HasPrefix(successor, "did:web:") || strings.HasPrefix(successor, "did:plc:")) {
setFlash(w, r, "error", "Successor must be a valid did:web: or did:plc: DID")
http.Redirect(w, r, "/admin#settings", http.StatusFound)
return
}

View File

@@ -51,7 +51,7 @@
<small class="text-base-content/60">DID of the successor hold. When set, the appview redirects all requests to the successor.</small>
</span>
<input type="text" name="successor" class="input input-bordered w-full font-mono text-sm"
placeholder="did:web:hold.example.com"
placeholder="did:web:hold.example.com or did:plc:..."
value="{{.Settings.Successor}}">
</label>
</div>