Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Nopass Laravel Package

lakm/nopass

Passwordless authentication helpers for Laravel 10/11. Send secure verification links or one-time passcodes (OTP) to log users in without passwords. Includes configuration, usage examples, testing, and security guidance.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Laravel-Native Integration: Designed for Laravel 10–13, leveraging its service container, facades, and event system. Aligns with Laravel’s authentication contracts (Illuminate\Contracts\Auth\Authenticatable), enabling seamless integration with existing auth stacks (Breeze, Jetstream, Sanctum, Passport).
  • Modular Passwordless Layer: Adds email magic links and OTP flows without replacing traditional auth, enabling hybrid or phased adoption.
  • Stateless Validation: Uses signed URLs (for email links) and time-bound OTPs, reducing server-side session complexity and improving scalability.
  • Extensibility Points:
    • Custom Providers: Supports swapping email/OTP delivery (e.g., replace Mailgun with AWS SES).
    • Event Hooks: Likely emits events (e.g., NoPassGenerated, NoPassValidated) for analytics, logging, or custom logic.
    • Middleware Integration: Can be wrapped in rate-limiting or CSRF middleware for security.

Integration Feasibility

  • Low-Coupling Design:
    • Facade-Driven: NoPass facade abstracts complexity, requiring minimal boilerplate.
    • Fluent API: Chaining methods (e.g., NoPass::for($user)->email()->generate()) simplifies implementation.
    • Demo-Ready: Includes a sample project with Breeze integration.
  • Prerequisites:
    • Email Service: For magic links (e.g., Mailgun, Postmark).
    • SMS Gateway: For OTPs (e.g., Twilio, AWS SNS) — not included; adds a dependency.
    • Route Configuration: Requires defining routes for link/OTP validation (e.g., login-link, verify-otp).
  • Gaps:
    • Session Handling: Post-validation, the package does not auto-login users; requires manual Auth::login($user) or middleware.
    • Fallback Logic: No built-in handling for failed validations (e.g., redirecting to password fallback).

Technical Risk

Risk Area Severity Mitigation
Security Medium - Audit signed URL generation (e.g., signedRoute()) for replay attacks.
- Implement CSRF tokens for email links or use one-time-use tokens.
- Add rate limiting (e.g., Laravel’s throttle) to OTP/email generation.
Performance Low - Test OTP/email delivery under load (e.g., 10K requests/hour).
- Use queue workers for mail/SMS to avoid blocking requests.
Compatibility Low - Verify with Laravel 12/13’s latest auth contracts (e.g., MustVerifyEmail).
Maintenance Low - MIT license; monitor for updates (last release: 2026-04-20).
User Experience Medium - Design fallback flows (e.g., "No email? Use OTP" or "Try password").

Key Questions

  1. Auth Stack Sync:
    • How will this integrate with our session driver (e.g., Sanctum API tokens, database sessions) post-validation?
  2. Hybrid Auth:
    • Should we support both passwordless and traditional auth (e.g., toggle in settings) or enforce passwordless-only?
  3. OTP Delivery:
    • Which SMS provider will we use, and how will we handle failures (e.g., invalid numbers, delivery delays)?
  4. Security Tradeoffs:
    • Are we comfortable with stateless links/OTPs (no server-side session), or do we need server-side tokens?
  5. Analytics:
    • How will we track passwordless auth success/failure rates (e.g., abandoned OTPs, link clicks)?
  6. Compliance:
    • Does our use case require audit logs for OTP/email generation (e.g., for GDPR or financial apps)?

Integration Approach

Stack Fit

  • Laravel 10–13: Native support with zero breaking changes to core auth.
  • Auth Systems:
    • Breeze/Jetstream: Replace LoginController with custom logic using NoPass::for($user)->email()->generate().
    • Sanctum/Passport: Extend token guards to accept passwordless-authenticated users.
    • Custom Auth: Integrate with existing Authenticatable models via the NoPass facade.
  • Frontend:
    • Blade/Tailwind: Use the package’s email templates or override them for branding.
    • APIs: Return OTP/link generation endpoints (e.g., /auth/otp, /auth/link).
  • Third-Party Services:
    • Email: Replace Laravel’s default mailer with a provider (e.g., Mailgun, SendGrid).
    • SMS: Integrate Twilio/AWS SNS for OTP delivery (requires custom logic to send OTPs via the provider’s API).

Migration Path

  1. Phase 1: Pilot (Guest Users)

    • Implement email magic links for non-registered users (e.g., guest checkout, demo access).
    • Use existing auth stack but bypass password requirements for these flows.
    • Tools: NoPass::for($user)->email()->generate() + custom route for validation.
  2. Phase 2: Hybrid Auth

    • Add OTP fallback for users without email access (e.g., mobile-only users).
    • Modify login page to offer "Email Link" or "OTP" options.
    • Tools: NoPass::for($user)->otp()->generate() + Twilio integration.
  3. Phase 3: Full Passwordless

    • Deprecate password fields in favor of OTP/email-only login.
    • Update LoginController to redirect to passwordless flows by default.
    • Tools: Middleware to enforce passwordless auth for specific user roles.

Compatibility

  • Laravel Versions: Tested on 10–13; verify with composer require lakm/nopass and php artisan vendor:publish for config.
  • Auth Contracts: Ensure your User model implements Illuminate\Contracts\Auth\MustVerifyEmail if using email links.
  • Queue Workers: Required for email/OTP delivery to avoid timeouts (configure MAIL_MAILER=queue in .env).
  • Database: No migrations needed; uses Laravel’s default users table + optional no_pass_attempts (if tracking).

Sequencing

  1. Setup:
    • Install: composer require lakm/nopass.
    • Publish config: php artisan vendor:publish --provider="LakM\NoPass\NoPassServiceProvider".
    • Configure email/SMS providers in .env.
  2. Backend:
    • Create routes for link/OTP validation (e.g., Route::get('/verify-link', [NoPassController::class, 'verify'])).
    • Extend LoginController to use NoPass::for($user)->email()->generate().
  3. Frontend:
    • Add UI for "Send Login Link" or "Request OTP" buttons.
    • Handle validation responses (e.g., redirect to dashboard on success).
  4. Testing:
    • Unit test NoPass facade methods (e.g., generate(), isValid()).
    • Integration test email/OTP flows with Laravel’s MailFake or Twilio’s sandbox.
  5. Monitoring:
    • Log NoPass events (e.g., NoPassGenerated) to track usage.
    • Set up alerts for failed OTP deliveries or brute-force attempts.

Operational Impact

Maintenance

  • Pros:
    • MIT License: No vendor lock-in; can fork or modify if needed.
    • Active Development: Last release in 2026; changelog shows Laravel 12/13 support.
    • Minimal Dependencies: Only relies on Laravel core and third-party email/SMS providers.
  • Cons:
    • No Official Support: Community-driven; issues require GitHub discussions.
    • Custom Logic: Extensions (e.g., rate limiting, custom templates) require manual maintenance.
  • Tasks:
    • Quarterly Audits: Review for security updates (e.g., cryptographic changes).
    • Dependency Updates: Monitor Laravel core updates for compatibility.

Support

  • Troubleshooting:
    • Common Issues:
      • OTPs not delivered? Check SMS provider credentials in .env.
      • Links expired? Verify NoPass config for link_expiration_minutes.
      • Users not logged in? Ensure Auth::login($user) is called post-validation.
    • Debugging Tools:
      • Laravel’s tail -f storage/logs/laravel.log for NoPass events.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity