UNPKG

@towercg2/server

Version:

The server runtime for the TowerCG2 video graphics system.

10 lines (7 loc) 438 B
export type AuthnFunction = (clientId: string, clientSecret: string) => Promise<boolean>; export function SinglePassword(plaintext: string): AuthnFunction { return async (clientId: string, clientSecret: string) => clientSecret === plaintext; } export function LookupAuth(credentials: { [clientId: string]: string }): AuthnFunction { return async (clientId: string, clientSecret: string) => credentials[clientId] === clientSecret; }