Files
CatoandClaude Opus 5.5 ec56542705 fix(orangecat): a real Auth.js adapter fits withOrangecatIdentity (v0.2.1) (#3)
v0.2.0 typed the adapter slice with property syntax and Promise returns, so
no Auth.js Adapter (methods taking AdapterUser, returning Awaitable<…>)
could be passed: petvity and surf-your-life failed typecheck on adoption.
Method syntax checks parameters bivariantly and accepts any return.

test/types/adapter.ts compiles the wrapper against the REAL @auth/core
Adapter type (dev dependency, types only) in `typecheck`. Mutated: restoring
the v0.2.0 shape gives 4 errors there.

README: SignInError needs styles.css imported, or it renders as bare text.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 05:06:43 -07:00

19 lines
868 B
TypeScript

// Compile-time contract against the REAL Auth.js adapter type: it must fit
// withOrangecatIdentity and come back as the same type. v0.2.0 failed exactly
// this in petvity and surf-your-life ("Argument of type 'Adapter' is not
// assignable to parameter of type 'AdapterSlice'"), and no test could see it
// because nothing here imported an Auth.js type. @auth/core is a dev
// dependency for this file only; the published module imports nothing from it.
import type { Adapter, AdapterUser } from "@auth/core/adapters";
import {
withOrangecatIdentity,
type OrangecatUserStore,
} from "../../src/orangecat.js";
declare const base: Adapter;
declare const store: OrangecatUserStore<AdapterUser>;
const wrapped: Adapter = withOrangecatIdentity(base, store);
const kept: Adapter = withOrangecatIdentity(base, store, { keepTokens: true });
export { wrapped, kept };