forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview: repo: trim leading @ from collaborator's handle

The "add collaborator" form currently fails if you submit a handle like `@example.com`, since the identity gets forwarded eventually directly to Bluesky's identity parse, which does not accept the `@` prefix for handles.

This change is targetted to only fix that one form.

Signed-off-by: phil <uniphil@gmail.com>

Changed files
+3
appview
repo
+3
appview/repo/repo.go
···
return
}
+
// remove a single leading `@`, to make @handle work with ResolveIdent
+
collaborator = strings.TrimPrefix(collaborator, "@")
+
collaboratorIdent, err := rp.idResolver.ResolveIdent(r.Context(), collaborator)
if err != nil {
fail(fmt.Sprintf("'%s' is not a valid DID/handle.", collaborator), err)