Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@startup-api/cloudflare",
"version": "0.4.3",
"version": "0.4.4",
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion public/users/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@ <h3>Link another account</h3>
}
function credentialIdentifier(c) {
if (c.provider === 'atproto') {
return c.handle ? `${c.handle} (${c.subject_id})` : c.subject_id;
if (!c.handle) return c.subject_id;
return `<span style="font-size: 1.05rem; font-weight: 600;">@${c.handle}</span> <span style="opacity: 0.6;">(${c.subject_id})</span>`;
}
return c.email || c.subject_id;
}
Expand Down
8 changes: 6 additions & 2 deletions src/handlers/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,14 @@ function providerLabel(provider: string): string {
return provider.charAt(0).toUpperCase() + provider.slice(1);
}

/** The identifier shown under the provider name. atproto shows the handle with the DID in parens. */
/**
* The identifier shown under the provider name. atproto emphasizes the handle (larger, with an `@`)
* and de-emphasizes the DID in parentheses.
*/
function credentialIdentifier(c: any): string {
if (c.provider === 'atproto') {
return c.handle ? `${c.handle} (${c.subject_id})` : c.subject_id;
if (!c.handle) return c.subject_id;
return `<span style="font-size: 1.05rem; font-weight: 600;">@${c.handle}</span> <span style="opacity: 0.6;">(${c.subject_id})</span>`;
}
return c.email || c.subject_id;
}
Expand Down
5 changes: 3 additions & 2 deletions test/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,10 @@ describe('Integration Tests', () => {
expect(html).toContain('twitch@example.com');
expect(html).toContain('providers="google,twitch,patreon"');
expect(html).not.toContain('{{ssr:profile_name}}');
// atproto credential: branded label + "handle (did)" identifier, not the bare provider key.
// atproto credential: branded label + "@handle (did)" identifier, not the bare provider key.
expect(html).toContain('Atmosphere / ATproto');
expect(html).toContain('tester.bsky.social (did:plc:abc123)');
expect(html).toContain('@tester.bsky.social');
expect(html).toContain('(did:plc:abc123)');
// The old Bluesky butterfly mark must not appear anywhere on the rendered page (SSR or client script).
expect(html).not.toContain('M12 10.5C10.9');
});
Expand Down