wingsline/passwordlessauth

Passwordless Authentication for Laravel

v1.0.1 2020-06-24 16:41 UTC

README

Latest Version on Packagist Total Downloads Build Status StyleCI

This package will enable passwordless authentication using temporary signed routes. Take a look at contributing.md to see a to do list.

Installation

Create a new Laravel application with:

laravel new myapp --auth

Via Composer

$ composer require wingsline/passwordlessauth

Remove the Auth::routes(); from the routes/web.php and replace it with:

use Wingsline\PasswordlessAuth\Facades\PasswordlessAuth;

PasswordlessAuth::routes();

Replace the following route names in the original views with the passwordless. prefix:

  • login -> passwordless.login
  • register -> passwordless.register
  • logout -> passwordless.logout
  • verification.resend -> passwordless.verification.resend

Replace the auth middleware in app/Http/Kernel.php:

protected $routeMiddleware = [
        'auth' => \Wingsline\PasswordlessAuth\Middleware\Authenticate::class,
    ]

Add the following method to the User model and make sure the model implements the Illuminate\Contracts\Auth\MustVerifyEmail interface:

use Wingsline\PasswordlessAuth\Notifications\VerifyEmail;

/**
 * Send the email verification notification.
 *
 * @return void
 */
public function sendEmailVerificationNotification()
{
    $this->notify(new VerifyEmail);
}

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email wingsline@gmail.com instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.