Skip to content

Commit 7e3f1e7

Browse files
Improvements to AuthProto/Titles capitalization, loader tests, and first release of atproto badges library (#36)
* ATproto bug fix + some improvement to dev ports/readme * Capitalize titles * loader tests * authprotof fixes * release atproto badges * fix lock * fix lint * linter fixes * DUDE * fix types
1 parent f7b237d commit 7e3f1e7

36 files changed

Lines changed: 4195 additions & 303 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@fujocoded/atproto-badges": minor
3+
---
4+
5+
Initial release of `@fujocoded/atproto-badges` — ATProto badge attestation utilities for creating, signing, and verifying badges per the badge.blue specification.
6+
7+
Also ships a `/react` subpath export with drop-in `<BadgeSection>`, `<BadgePill>`, `<BadgeClaim>`, and `<BadgeCertificate>` components, plus a `/styles.css` import. Components take async action handlers (`onClaim`/`onVerify`/`onUnclaim`) and theming props (`issuerName`, `getBadgeShortName`, `isRemoteBadge`, custom icon renderers), so consumers wire them to their own backend without forking. Requires Tailwind v4 in the consuming project.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@fujocoded/authproto": patch
3+
---
4+
5+
Fix custom-redirect / referer parsing in the OAuth callback so encoded
6+
`redirect` and `referer` values are no longer silently dropped on login.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@fujocoded/authproto": patch
3+
---
4+
5+
Fix custom-redirect / referer state parsing in the OAuth callback. The OAuth client wraps our state under an opaque key in the URL `state` param and returns the original value as `clientCallback.state`, so we now read from there instead of `requestUrl.searchParams.get("state")` — which was always the wrapped value and never parsed as JSON.
6+
7+
Also improve `astro-authproto` README and `02-read-bsky-profile` example:
8+
9+
- Document `session` driver setup and full integration config in install steps.
10+
- Clarify `applicationDomain` should be the full URL with scheme (e.g. `https://example.com`, or `http://127.0.0.1:4321` locally).
11+
- Add a "Shipping it" production section.
12+
- Update the read-profile example to use `getBlueskyAgent` from `@fujocoded/authproto/helpers` instead of constructing `AtpBaseClient` directly, and fix the avatar `alt` to use a JSX expression.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@fujocoded/authproto": patch
3+
---
4+
5+
Use Astro's actual dev server port for the OAuth callback URL in development
6+
instead of always assuming `4321`. If you run `astro dev --port 4322` (or set
7+
`server.port` in your Astro config), Authproto now points OAuth at the right
8+
local URL.

astro-atproto-loader/__examples__/03-grouped-reposts/src/live.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ import { defineAtProtoLiveCollection } from "@fujocoded/astro-atproto-loader";
2121
// Set up validation for schemas via zod
2222
const BlobRefSchema = z
2323
.object({
24-
ref: z.unknown(),
24+
ref: z.union([z.string(), z.object({ $link: z.string() })]).nullish(),
2525
mimeType: z.string(),
2626
})
2727
.transform((blob) => ({
28-
cid: blob.ref == null ? undefined : String(blob.ref),
28+
cid:
29+
blob.ref == null
30+
? undefined
31+
: typeof blob.ref === "string"
32+
? blob.ref
33+
: blob.ref.$link,
2934
mimeType: blob.mimeType,
3035
}));
3136

0 commit comments

Comments
 (0)