elao/voucher-authentication-bundle
Symfony bundle enabling voucher (email link) authentication. Register the bundle, import routes, and enable the “voucher” firewall. Generate and persist disposable voucher tokens in your app or via CLI, then send users a login/activation link with an optional TTL.
elao/voucher-authentication-bundle is a niche but valid solution for email-link-based authentication (magic links), which fits applications requiring passwordless login (e.g., internal tools, B2B portals, or low-friction user onboarding). It aligns with architectures where:
Illuminate/Contracts/Auth and Illuminate/Foundation). Compatibility with Laravel’s service providers, middlewares, and event system reduces customization overhead.Mail facade) for voucher delivery.VoucherGuard).VoucherAuthMiddleware for protecting routes.VoucherGenerated and VoucherConsumed events for hooks (e.g., analytics, notifications).| Risk Area | Severity | Mitigation |
|---|---|---|
| Security Vulnerabilities | High | - Validate token generation (e.g., CSRF protection, token length/complexity). |
| - Audit event listeners for sensitive data exposure. | ||
| Performance Bottlenecks | Medium | - Database queries for token validation (index vouchers table on user_id, expires_at). |
| - Consider caching frequently accessed vouchers (e.g., Redis). | ||
| Compatibility Issues | Low | - Test with Laravel’s latest LTS (e.g., 10.x). |
- Verify conflicts with existing auth guards (e.g., session, api). |
||
| Maintenance Overhead | Medium | - Bundle is unmaintained (1 star, no recent commits). Fork or vendorize. |
| - Document customizations for future updates. |
Auth::attempt())? If so, how will this guard coexist?composer require elao/voucher-authentication-bundle
php artisan vendor:publish --tag=voucher-authentication-config
config/auth.php to add the voucher guard.'guards' => [
'voucher' => [
'driver' => 'voucher',
'provider' => 'users',
],
],
Route::get('/dashboard', function () {
// ...
})->middleware('auth:voucher');
session) remain unchanged.auth.php to redirect failed voucher attempts to another guard.vouchers table (migration provided). Ensure it doesn’t conflict with existing users or password_resets.throttle middleware).VoucherGenerated)./vendor/custom/ and maintain locally.yourorg/voucher-auth-bundle).composer.json to avoid breaking changes.voucher.ttl in config).vouchers table indexes).auth:attempt debugging for guard issues.How can I help you explore Laravel packages today?