Laravel 5.7的无密码身份验证驱动程序

网友投稿 766 2022-10-22

Laravel 5.7的无密码身份验证驱动程序

Laravel 5.7的无密码身份验证驱动程序

This package has been abandoned. If you need Passwordless Authentication, migrate to Laravel Passwordless Login.

Passless

Passwordless Authentication Driver for Laravel. Just add water.

Requirements

Laravel 6 or Laravel 7

Check older releases for older Laravel versions.

What includes

Passless Authentication Guard DriverPassless Login ControllerLoginAuthentication NotificationLittle magic

Install

Just fire up Composer and require it into your Laravel project:

composer require darkghosthunter/passless

How it works

This guards extends the default SessionGuard and only overrides the authentication method to not check the password, only if the user exists by the given credentials (email or whatever keys you set in your form or controller).

To register your users without a password, allow in your migration files the password string to be nullable(). Alternatively, pass an empty string on registration.

Schema::create('users', function (Blueprint $table) { // ... $table->string('password')->nullable(); $table->rememberToken(); $table->timestamps();});

In your login form, you can discard the password input and leave only the email or username.

@csrf
上一篇:android:获取手机号码和姓名实现通讯录
下一篇:SpringCloud Bus组件的使用配置详解
相关文章

 发表评论

暂时没有评论,来抢沙发吧~