mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-06-09 08:42:35 +00:00
fix did validation in hold admin
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user