alexusmai / vue-laravel-file-manager

Frontend for Laravel File Manager on Vue.js
MIT License
359 stars 161 forks source link

419 (unknown status) #10

Closed ustabasiibrahim closed 5 years ago

ustabasiibrahim commented 5 years ago

I'm getting this error when trying to load the file continuously, why?

screenshot_1

alexusmai commented 5 years ago

Do you add csrf-token?

<!-- CSRF Token --> <meta name="csrf-token" content="{{ csrf_token() }}">

And check folder permissions, php params - upload_max_filesize, post_max_size

ustabasiibrahim commented 5 years ago

This is a SPA project. How to add token?

alexusmai commented 5 years ago

Put In to <head></head> block

ustabasiibrahim commented 5 years ago

I used vue cli when creating the project. I'm just using Laravel for the API. So I don't have any .blade files.

alexusmai commented 5 years ago

The VerifyCsrfToken middleware, which is included in the web middleware group, will automatically verify that the token in the request input matches the token stored in the session (Laravel docs)

Delete "web" middleware from laravel-filemanager config file

/**
     * Middleware
     * Add your middleware name to array -> ['web', 'auth', 'admin']
     * !!!! RESTRICT ACCESS FOR NON ADMIN USERS !!!!
     */
    'middleware'    => ['web', 'auth']