mirror of
https://github.com/bitbaum/accountkit.git
synced 2026-12-04 12:07:37 +01:00
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>
19 lines
868 B
TypeScript
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 };
|