invisnik / laravel-steam-auth

Laravel Steam Auth
MIT License
172 stars 67 forks source link

Wasn't able to get the logout function working... #59

Closed Dreamborg closed 7 years ago

Dreamborg commented 7 years ago

Wasn't able to get the logout function working with the README's: Route::post('logout', 'Auth\LoginController@logout')->name('logout');

This was done on a fresh install of Laravel.

I was able to get it to work using a get request instead.

Route::get('logout', 'Auth\LoginController@logout')->name('logout');

invisnik commented 7 years ago

For logout better use post method. For example:

<a href="{{ route('logout') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">Logout</a>

<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>