@passport-next/passport-types
v0.3.1
Published
Shared, augmentable type contracts for Passport Next and its strategies.
Readme
@passport-next/passport-types
Dependency-light, augmentable contracts shared by Passport Next, applications, and authentication strategies.
Install
pnpm i @passport-next/passport-types @passport-next/http-typesUsage
import type {
AuthInfo,
Request,
User,
} from '@passport-next/passport-types';Applications describe their own authentication values with module augmentation:
import '@passport-next/passport-types';
declare module '@passport-next/passport-types' {
interface User {
id: string;
username: string;
}
interface AuthInfo {
scope?: string[];
}
interface Request {
tenantId?: string;
}
}The base Request extends the framework-neutral request from @passport-next/http-types, so augmentations to that package are also visible to Passport consumers.
