pharaoh_jwt_auth 1.0.0+2 pharaoh_jwt_auth: ^1.0.0+2 copied to clipboard
Pharaoh middleware that validates a JsonWebToken (JWT) and set the req.auth with the attributes
example/pharaoh_jwt_auth_example.dart
import 'package:pharaoh/pharaoh.dart';
import 'package:pharaoh_jwt_auth/pharaoh_jwt_auth.dart';
void main() async {
final app = Pharaoh();
app.use(jwtAuth(secret: () => SecretKey('some-secret-key')));
app.get('/', (req, res) => res.ok('Hello World'));
await app.listen();
}