Effect CommunityEC
Effect Community13mo ago
3 replies
Gary

Using `provides` Type in Handlers with Authorization Middleware

If you define a provides type, how are you supposed to use this in your handlers if the authorization middleware returns the user?
export class AuthorizationMiddleware extends HttpApiMiddleware.Tag<AuthorizationMiddleware>()(
  'AuthorizationMiddleware',
  {
    provides: CurrentUser,
    failure: Unauthorized,
    security: { bearer: HttpApiSecurity.bearer },
  },
) {}
Was this page helpful?