this repo has no description
1
fork

Configure Feed

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

Drop vestigial storage adapter from startOAuthLogin

`startOAuthLogin` never touched the storage adapter it accepted —
the WASM function only resolves the PDS, discovers the AS, generates
DPoP/PKCE/state, fires the PAR request, and returns the auth URL +
serializable pending state. The existing comment in the body even
spells it out: "Config is NOT saved here — the user hasn't authorized
yet."

The parameter was paying for itself in nothing and forcing every SDK
caller to construct a `WasmStorageAdapter` for a no-op. Dropping it:

- Removes `_storage_adapter: JsStorageAdapter` from the WASM extern.
- Removes `storage: Storage` from `StartLoginOptions` in @opake/sdk.
- Drops the `createStorageAdapter(options.storage)` call in
`Opake.startLogin`; adjusts `Opake.login` (which composes start +
complete) to omit `storage` from the start half only — complete
still needs it.
- Web auth store: stops reading `getStorage()` before calling
`Opake.startLogin`.

Downstream callers that were passing storage to `startLogin` will
see a TS error at the call site — the fix is a one-line removal.
No runtime behaviour change; any build that passed storage was just
wasting an adapter allocation per login start.

+1 -8
-2
apps/web/src/stores/auth.ts
··· 347 347 const done = loading("login"); 348 348 try { 349 349 const { Opake } = await loadSdk(); 350 - const s = await getStorage(); 351 350 const { authUrl, pending } = await Opake.startLogin(handle, { 352 - storage: s, 353 351 redirectUri: redirectUri(), 354 352 }); 355 353
-2
crates/opake-wasm/src/auth_wasm.rs
··· 65 65 pub async fn start_oauth_login( 66 66 handle: &str, 67 67 redirect_uri: &str, 68 - storage_adapter: JsStorageAdapter, 69 68 ) -> Result<JsValue, JsError> { 70 69 let transport = WasmTransport::new(); 71 - let storage = JsStorage::new(storage_adapter); 72 70 let mut rng = OsRng; 73 71 74 72 // 1. Resolve handle → DID + PDS URL
-1
packages/opake-sdk/src/auth.ts
··· 51 51 52 52 /** Options for the two-step login flow. */ 53 53 export interface StartLoginOptions { 54 - readonly storage: Storage; 55 54 readonly redirectUri: string; 56 55 }
+1 -3
packages/opake-sdk/src/opake.ts
··· 260 260 */ 261 261 static async login(handle: string, options: LoginOptions): Promise<void> { 262 262 const { authUrl, pending } = await Opake.startLogin(handle, { 263 - storage: options.storage, 264 263 redirectUri: options.redirectUri, 265 264 }); 266 265 const { code, state } = await options.authorize(authUrl); ··· 332 331 options: StartLoginOptions, 333 332 ): Promise<{ authUrl: string; pending: PendingLogin }> { 334 333 const wasm = await initWasm(); 335 - const adapter = createStorageAdapter(options.storage); 336 - const result = await wasm.startOAuthLogin(handle, options.redirectUri, adapter); 334 + const result = await wasm.startOAuthLogin(handle, options.redirectUri); 337 335 return result as { authUrl: string; pending: PendingLogin }; 338 336 } 339 337