vania_auth 1.0.0 copy "vania_auth: ^1.0.0" to clipboard
vania_auth: ^1.0.0 copied to clipboard

Complete authentication system for Vania framework - JWT, tokens, guards, password hashing, and revocation.

example/vania_auth_example.dart

import 'package:vania_auth/vania_auth.dart';

void main() async {
  JwtService().configure(
    secretKey: 'your-secret-key-here',
    audience: 'your-app',
    issuer: 'your-app',
  );

  final hasher = PasswordHasher();
  final hashed = hasher.make('my-password');
  print('Hashed: $hashed');
  print('Verify: ${hasher.verify('my-password', hashed)}');

  final token = JwtService().createToken(
    payload: {'id': 1, 'email': 'user@example.com'},
    guard: 'web',
    withRefreshToken: true,
  );
  print('Access Token: ${token['access_token']}');
  print('Refresh Token: ${token['refresh_token']}');

  final payload = JwtService().verify(
    token['access_token'],
    'web',
    'access_token',
  );
  print('Payload: $payload');
}
1
likes
150
points
86
downloads

Documentation

Documentation
API reference

Publisher

verified publishervdart.dev

Weekly Downloads

Complete authentication system for Vania framework - JWT, tokens, guards, password hashing, and revocation.

Homepage
Repository (GitHub)
View/report issues

Topics

#server #backend #authentication #jwt #vania

License

MIT (license)

Dependencies

crypto, dart_jsonwebtoken, meta, vania

More

Packages that depend on vania_auth