我使用的新星一样后端的SaaS应用程序所以基本上要app.mydoain.com刚弹出的新星登录表单。我想是标配使用了这个(所以当我添加用户,他们必须验证可以登录之前,电子邮件)Laravel 5.7电子邮件验证。
在配置/ nova.php我添加了中间件:
'middleware' => [
'verified',
'web',
Authenticate::class,
DispatchServingNovaEvent::class,
BootTools::class,
Authorize::class,
],
在user.php的模式,我实现了它(这是不是有网站的文档不同的做法?)
<?php
namespace App;
use Illuminate\Auth\MustVerifyEmail;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Contracts\Auth\MustVerifyEmail as MustVerifyEmailContract;
class User extends Authenticatable implements MustVerifyEmailContract
{
use MustVerifyEmail, Notifiable;
....
我加入web.php部分航线的只是验证(不需要任何其他AUTH)
Route::get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
Route::get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify');
Route::get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
当我登录它只是摊上了,要么去/email/verify
或/
。在我的分贝我已经添加时间戳所以它不应该走在所有/email/verify
,当它进入/
其超时。
如果我从中间件在配置删除verified
它工作正常,但没有电子邮件验证检查。
更改中间件的顺序。
'middleware' => [
'web',
Authenticate::class,
'verified',
DispatchServingNovaEvent::class,
BootTools::class,
Authorize::class,
],
您的请求必须先通过网络。最有可能你正在因为重定向循环的超时。