dart_frog_auth library

Header auth based middlewares for Dart Frog

Functions

basicAuthentication<T extends Object>({Future<T?> userFromCredentials(String username, String password)?, Future<T?> authenticator(RequestContext context, String username, String password)?, Applies applies = _defaultApplies}) → Middleware
Authentication that uses the Authorization header with the Basic scheme.
bearerAuthentication<T extends Object>({Future<T?> userFromToken(String token)?, Future<T?> authenticator(RequestContext context, String token)?, Applies applies = _defaultApplies}) → Middleware
Authentication that uses the Authorization header with the Bearer scheme.

Typedefs

Applies = Future<bool> Function(RequestContext)
Function definition for the predicate function used by Dart Frog Auth middleware to determine if the request should be authenticated or not.