API Reference

Auth Guards

Focused reference for Flint Dart and Flint UI APIs, with copyable examples and practical notes.

Auth Guards

Protect routes with middleware and request auth helpers.

Flint does not require a separate guard system. Use middleware and ctx.req.user to enforce access.

Example

CodeBlock dart
class AuthGuard extends Middleware {
  @override
  Handler handle(Handler next) {
    return (Context ctx) async {
      final user = await ctx.req.user;
      if (user == null) {
        return ctx.res.status(401).json({'error': 'Unauthorized'});
      }
      return next(ctx);
    };
  }
}

app.get('/dashboard', (Context ctx) async => ctx.res.send('ok'))
  .useMiddleware(AuthGuard());
Flint Dart logo
Flint EcosystemThe Unified Dart Technology Stack

One language powering Full-Stack Web, Cross-Platform Clients, Native AI, and Connected Robotics.

Fullstack
Client SDK
AI Engine
Hardware
Copyright 2026 Flint Dart. Maintained by Eulogia Technologies.
v 1.3.2
MIT License
Built with Dart