payload-oauth2
Version:
OAuth2 plugin for Payload CMS
20 lines (19 loc) • 817 B
TypeScript
import type { PayloadRequest, User, UserSession } from "payload";
type AuthConfigWithSessions = {
disableLocalStrategy?: unknown;
tokenExpiration?: number;
useSessions?: boolean;
};
type CollectionConfigWithAuthSessions = {
auth?: boolean | AuthConfigWithSessions;
slug: string;
};
export declare const shouldUsePayloadSessions: (collectionConfig: CollectionConfigWithAuthSessions) => boolean;
export declare const removeExpiredPayloadSessions: (sessions: UserSession[]) => UserSession[];
export declare const userHasPayloadSession: (user: User, sid: string) => boolean;
export declare const addPayloadSessionToUser: ({ collectionConfig, req, user, }: {
collectionConfig: CollectionConfigWithAuthSessions;
req: PayloadRequest;
user: User;
}) => Promise<string | undefined>;
export {};