MCPcopy Create free account
hub / github.com/pollinations/pollinations / assertNotBanned

Function assertNotBanned

shared/auth/api-key.ts:190–200  ·  view source on GitHub ↗
(user: {
    banned?: boolean | null;
    banExpires?: Date | string | null;
    banReason?: string | null;
})

Source from the content-addressed store, hash-verified

188}
189
190export function assertNotBanned(user: {
191 banned?: boolean | null;
192 banExpires?: Date | string | null;
193 banReason?: string | null;
194}): void {
195 if (user.banned !== true) return;
196 if (user.banExpires && new Date(user.banExpires) <= new Date()) return;
197 throw new BannedAccountError(
198 user.banReason ? `Account banned: ${user.banReason}` : "Account banned",
199 );
200}
201
202export async function authenticateApiKeyRequest(opts: {
203 request: Request;

Callers 2

authenticateSessionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected