A type representing the environment variables used by the
isAuthenticated function. Can be used as a type variable for a
Function's Context type, IE: Context<AuthEnvVars>.
A Serverless Event with headers representing authentication data.
Uses Twilio Functions' support for the HTTP authorization header to
check if an incoming request is authenticated.
This function expects the environment variables in AuthEnvVars to be defined in the calling Function's environment.
Note that isAuthenticated currently only works for one pre-defined username
and passcode.
Usage:
if (!isAuthenticated(context, event)) {
return callback(null, 'Invalid credentials');
}
A Serverless Context containing authentication environment variables.
An incoming Serverless request.
true if the incoming request's credentials match those given in the Function's environment variables. false otherwise.
Generated using TypeDoc
Authentication-related utilities for use with Twilio Functions.