Spaces:
Runtime error
Runtime error
File size: 870 Bytes
077865a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | export interface SessionUser {
userId: number;
email: string;
}
export declare function userCount(): number;
/** Create a user. Throws { code: 'email_taken' } if the email already exists. */
export declare function createUser(email: string, password: string): SessionUser;
/** Verify credentials. Returns the user on success, null on failure. */
export declare function verifyCredentials(email: string, password: string): SessionUser | null;
/** Mint a session and return the raw token (only the hash is persisted). */
export declare function createSession(userId: number): string;
/** Resolve a session token to its user, or null if missing/expired. */
export declare function validateSession(token: string | undefined | null): SessionUser | null;
export declare function deleteSession(token: string | undefined | null): void;
//# sourceMappingURL=auth.d.ts.map |