亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Laravel 電子郵件驗證鏈接不起作用?

Laravel 電子郵件驗證鏈接不起作用?

PHP
蠱毒傳說 2023-04-23 17:55:39
我已經為我的 Laravel APP 設置了電子郵件驗證,但是當我注冊為用戶并轉到 mailtrap.io 并且當我單擊“驗證電子郵件地址”按鈕時,我得到 403 This action is unauthorized,但是如果我單擊重新發送驗證郵件,然后單擊它工作正常的按鈕。這是我的網絡路線:Auth::routes(['verify' => true]);Route::get('/home', 'HomeController@index')->name('home');Route::get('/', 'HomeController@index')->name('home');Route::resource('challenge', 'ChallengesController');Route::post('/challenge/join/{id}', 'ChallengesController@joinChallenge')->name('challenge.join');Route::delete('/challenge/finish/{id}', 'ChallengesController@finishChallenge')->name('challenge.finish');在我的用戶模型中,我實現了 MustVerifyEmail<?phpnamespace App;use Illuminate\Contracts\Auth\MustVerifyEmail;use Illuminate\Foundation\Auth\User as Authenticatable;use Illuminate\Notifications\Notifiable;class User extends Authenticatable implements MustVerifyEmail{    use Notifiable;    /**     * The attributes that are mass assignable.     *     * @var array     */    protected $fillable = [        'user_id', 'name', 'username', 'email', 'password',     ];    /**     * The attributes that should be hidden for arrays.     *     * @var array     */    protected $hidden = [        'password', 'remember_token',    ];    /**     * The attributes that should be cast to native types.     *     * @var array     */    protected $casts = [        'email_verified_at' => 'datetime',    ];    protected $primaryKey = 'user_id';    protected $keyType = 'string';}
查看完整描述

1 回答

?
海綿寶寶撒

TA貢獻1809條經驗 獲得超8個贊

確保您的身份驗證路徑不在身份驗證中間件中


Auth::routes(['verify' => true]);

Route::group(['middleware' => 'auth'], function () {


});


查看完整回答
反對 回復 2023-04-23
  • 1 回答
  • 0 關注
  • 159 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號