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
6 changes: 0 additions & 6 deletions src/app/.well-known/oauth-client-metadata/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ export async function GET() {
// src/app/api/auth/login/route.ts resolves the handle to its PDS
// and starts a fresh OAuth flow.
epds_handle_login_url: `${origin}/api/auth/login`,
// Browser-tab icon for trusted-client auth/consent pages (ePDS
// emits a <link rel="icon"> from this). SVG so it stays crisp at any
// tab size. No `favicon_url_dark` yet — the current brandmark has no
// white variant; add one (or an adaptive SVG) to ship a dark-theme
// tab icon.
favicon_url: `${origin}/brand/brandmark/certified_brandmark_black.svg`,
}

return NextResponse.json(metadata, {
Expand Down
20 changes: 0 additions & 20 deletions src/app/api/auth/callback-handler/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,6 @@ export async function GET(request: NextRequest) {
try {
const params = request.nextUrl.searchParams

// ePDS clean-exit (#154): when the OAuth flow can't complete — the
// user denied consent, the PAR/ticket expired, or they walked away —
// the provider redirects back here with a standard OAuth `error`
// param instead of a `code`. Detect it up front and return a
// retryable failure so the sign-in UI can offer "try again", rather
// than letting `client.callback()` throw an opaque 500.
const oauthError = params.get("error")
if (oauthError) {
logSafe("[auth] oauth error redirect", undefined, { code: oauthError })
const description = params.get("error_description") || undefined
return NextResponse.json(
{
error: description || "Sign-in was not completed",
code: oauthError,
retry: true,
},
{ status: 400 },
)
}

const client = await getOAuthClient()
const { session } = await client.callback(params)

Expand Down
2 changes: 1 addition & 1 deletion src/app/api/groups/[groupDid]/audit/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function GET(

const groupAgent = createGroupAgent(auth.agent, groupDid)

const queryParams: Record<string, string> = { repo: groupDid }
const queryParams: Record<string, string> = {}
const actorDid = request.nextUrl.searchParams.get("actorDid")
const action = request.nextUrl.searchParams.get("action")
const collection = request.nextUrl.searchParams.get("collection")
Expand Down
92 changes: 0 additions & 92 deletions src/app/api/groups/[groupDid]/destroy/route.ts

This file was deleted.

7 changes: 1 addition & 6 deletions src/app/api/groups/[groupDid]/handle/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ export async function PUT(
return NextResponse.json({ error: "Handle too long (max 253 characters)" }, { status: 400 })
}

// updateHandle is a stock atproto method with no `repo` field, so it
// can't use the new explicit-repo targeting — CGS identifies the
// group from the JWT `aud`. Keep this call on the legacy proxy form
// (group DID in `aud`) until CGS exposes a repo-targetable handle
// update. See CGS aud-migration.md.
const groupAgent = createGroupAgent(auth.agent, groupDid, { legacy: true })
const groupAgent = createGroupAgent(auth.agent, groupDid)

// Use the standard identity.updateHandle through the proxy
// The group service intercepts this and updates the group's handle
Expand Down
6 changes: 3 additions & 3 deletions src/app/api/groups/[groupDid]/members/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function GET(

const { data } = await groupAgent.call(
"app.certified.group.member.list",
{ repo: groupDid, limit }
{ limit }
)

return NextResponse.json(data)
Expand Down Expand Up @@ -86,7 +86,7 @@ export async function POST(
const { data } = await groupAgent.call(
"app.certified.group.member.add",
{},
{ repo: groupDid, memberDid, role },
{ memberDid, role },
{ encoding: "application/json" }
)

Expand Down Expand Up @@ -132,7 +132,7 @@ export async function DELETE(
await groupAgent.call(
"app.certified.group.member.remove",
{},
{ repo: groupDid, memberDid },
{ memberDid },
{ encoding: "application/json" }
)

Expand Down
2 changes: 1 addition & 1 deletion src/app/api/groups/[groupDid]/role/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function PUT(
await groupAgent.call(
"app.certified.group.role.set",
{},
{ repo: groupDid, memberDid, role },
{ memberDid, role },
{ encoding: "application/json" }
)

Expand Down
4 changes: 1 addition & 3 deletions src/app/api/groups/[groupDid]/upload-blob/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ export async function POST(

const groupAgent = createGroupAgent(auth.agent, groupDid)

// uploadBlob has a binary body, so the group selector goes on the
// querystring (body-less convention — see CGS aud-migration.md).
const { data } = await groupAgent.call(
"app.certified.group.repo.uploadBlob",
{ repo: groupDid },
{},
new Uint8Array(buffer),
{ encoding: contentType }
)
Expand Down
124 changes: 0 additions & 124 deletions src/app/api/groups/import/route.ts

This file was deleted.

5 changes: 1 addition & 4 deletions src/app/api/groups/register/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,7 @@ export async function POST(request: NextRequest) {
// entry is found — no later page can change the boolean answer.
let memberCursor: string | undefined
do {
const params: Record<string, unknown> = {
repo: g.groupDid,
limit: 100,
}
const params: Record<string, unknown> = { limit: 100 }
if (memberCursor) params.cursor = memberCursor
const { data } = await groupAgent.call(
"app.certified.group.member.list",
Expand Down
12 changes: 0 additions & 12 deletions src/app/groups/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -606,18 +606,6 @@ export default function CreateGroupPage() {
{isCreating ? "Creating…" : "Create group"}
</Button>
</div>

<p className="settings__note">
Already have an account you want to use as a group?{" "}
<button
type="button"
className="cursor-pointer border-0 bg-transparent p-0 text-[var(--fg-primary)] underline disabled:cursor-not-allowed disabled:opacity-50"
onClick={() => router.push("/groups/import")}
disabled={isCreating}
>
Import an existing account
</button>
</p>
</div>
</article>
</form>
Expand Down
Loading
Loading