← @mortar-kit/auth

allowEmailsfunction

import { allowEmails } from '@mortar-kit/auth'

function allowEmails(patterns: readonly string[]): (input: AuthorizeInput) => EmailUser | null

An authorize that lets in these addresses, compared case-insensitively; *@example.com lets in a whole domain. Everyone else is refused.

Parameters

patterns: readonly string[]

Returns

(input: AuthorizeInput) => EmailUser | null

Example

createAuth({ methods, secret, authorize: allowEmails(['[email protected]', '*@team.example.com']) });