Framework-agnostic OAuth integration for AT Protocol (Bluesky) applications.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add prompt parameter for OAuth-based account registration (v2.8.0)

+19 -3
+13
CHANGELOG.md
··· 2 2 3 3 All notable changes to this project will be documented in this file. 4 4 5 + ## [2.8.0] - 2026-02-15 6 + 7 + ### Added 8 + 9 + - **OAuth-based account registration**: The `/login` handler now accepts a 10 + `prompt` query parameter. Use `prompt=create` with a PDS URL as the handle to 11 + direct users to the PDS account registration page. After registration, the 12 + OAuth callback completes normally and the user is authenticated. 13 + 14 + ``` 15 + /login?handle=https://bsky.social&prompt=create 16 + ``` 17 + 5 18 ## [2.7.2] - 2026-02-15 6 19 7 20 ### Fixed
+2 -2
deno.json
··· 1 1 { 2 2 "$schema": "https://jsr.io/schema/config-file.v1.json", 3 3 "name": "@tijs/atproto-oauth", 4 - "version": "2.7.2", 4 + "version": "2.8.0", 5 5 "license": "MIT", 6 6 "exports": "./mod.ts", 7 7 "publish": { ··· 16 16 }, 17 17 "imports": { 18 18 "@std/assert": "jsr:@std/assert@1.0.16", 19 - "@tijs/oauth-client-deno": "jsr:@tijs/oauth-client-deno@5.0.1", 19 + "@tijs/oauth-client-deno": "jsr:@tijs/oauth-client-deno@5.1.0", 20 20 "@tijs/atproto-sessions": "jsr:@tijs/atproto-sessions@2.1.0", 21 21 "@tijs/atproto-storage": "jsr:@tijs/atproto-storage@0.1.1", 22 22 "@atproto/syntax": "npm:@atproto/syntax@0.3.0"
+3
src/routes.ts
··· 63 63 * Query parameters: 64 64 * - handle: User's AT Protocol handle or authorization server URL (required) 65 65 * - redirect: Relative path to redirect after OAuth (optional) 66 + * - prompt: OAuth prompt value, e.g. "create" for account registration (optional) 66 67 * - mobile: Set to "true" for mobile OAuth flow (redirects to mobileScheme) 67 68 * - pwa: Set to "true" for PWA OAuth flow (returns HTML with postMessage) 68 69 */ ··· 72 73 const redirect = url.searchParams.get("redirect"); 73 74 const mobile = url.searchParams.get("mobile") === "true"; 74 75 const pwa = url.searchParams.get("pwa") === "true"; 76 + const prompt = url.searchParams.get("prompt"); 75 77 76 78 if (!handle || typeof handle !== "string") { 77 79 return new Response("Invalid handle", { status: 400 }); ··· 112 114 const authUrl = await oauthClient.authorize(handle, { 113 115 state: JSON.stringify(state), 114 116 scope, 117 + ...(prompt ? { prompt } : {}), 115 118 }); 116 119 117 120 return new Response(null, {
+1 -1
src/types.ts
··· 82 82 */ 83 83 authorize( 84 84 handle: string, 85 - options?: { state?: string; scope?: string }, 85 + options?: { state?: string; scope?: string; prompt?: string }, 86 86 ): Promise<URL>; 87 87 88 88 /**