2015-10-05 132 views
0

我嘗試驗證用戶。我鍵入代碼並執行文檔laravel等步驟,但出現錯誤。這是我的形式laravel 5.1錯誤VerifyCsrfToken.php中的TokenMismatchException第53行:

在此處輸入代碼

{!! csrf_field() !!} 
First Name Last Name E-mail Address Sport: {{ $gametype }}> 
@foreach($games as $game) 
    <input type="checkbox" value="{{ old('game_type_id') }}"> {{ $game->name }}> 
@endforeach 

密碼確認密碼我與使用方面同意註冊或註冊連接已經連接到有一個帳戶?簽到!

這是路線://認證途徑......

Route::get('auth/login', 'Auth\[email protected]'); 
Route::post('auth/login', 'Auth\[email protected]');  
Route::get('auth/logout', 'Auth\[email protected]'); 

//註冊路線...

Route::get('auth/register', 'Auth\[email protected]'); 
Route::post('auth/register', 'Auth\[email protected]'); 

我的檔案登錄並註冊刀片是針對/ AUTH文件夾。當我註冊時在VerifyCsrfToken.php第53行中得到這個錯誤TokenMismatchException:

回答

1

根據官方文檔here,您必須使用當前令牌並輸入字段。

<input type="hidden" name="_token" value="{{csrf_token()}}" /> 

並使用Route::controller('auth','AuthController');而不是所有當前路線。

相關問題