Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Unable to connect to backend. #22

Closed
HenryDewa opened this issue Jul 5, 2014 · 5 comments
Closed

Error Unable to connect to backend. #22

HenryDewa opened this issue Jul 5, 2014 · 5 comments

Comments

@HenryDewa
Copy link
Contributor

hi i found a problem when trying to upload a file, where the message of the problem is Unable to connect to the backend, and it turns out the problem is because since this function on my filters.php file

Route :: filter ('CSRF', function ()
{
if (Session :: getToken ()! = Input :: get ('csrf_token') && Session :: getToken ()! = Input :: get ('_token'))
{
Route::filter('csrf', function()
{
if (Session::getToken() != Input::get('csrf_token') && Session::getToken() != Input::get('_token'))
{
throw new Illuminate\Session\TokenMismatchException;
}
});

How do I deal with these issues?

@barryvdh
Copy link
Owner

barryvdh commented Jul 5, 2014

Can't you disable the csrf filter for the elfinder routes?
Op 5 jul. 2014 18:16 schreef "Henry" notifications@github.com:

hi i found a problem when trying to upload a file, where the message of
the problem is Unable to connect to the backend, and it turns out the
problem is because since this function on my filters.php file

Route :: filter ('CSRF', function ()
{
if (Session :: getToken ()! = Input :: get ('csrf_token') && Session ::
getToken ()! = Input :: get ('_token'))
{
throw new Illuminate \ Firefox \ TokenMismatchException;
}
});

How do I deal with these issues?


Reply to this email directly or view it on GitHub
#22.

@HenryDewa
Copy link
Contributor Author

yes i can't, how disable the csrf filter for the elfinder routes?

@ahmadazimi
Copy link

I guess you can pass the csrf_tokn to the elfinder initializing script with cutomData option.

$('#elfinder').elfinder({
   costomData: {
     _token:  <?php echo csrf_token(); ?>
   },
    url : '<?= URL::action('Barryvdh\Elfinder\ElfinderController@showConnector') ?>'
});

@HenryDewa
Copy link
Contributor Author

thanks @ahmadazimi for u help. SOLVED.
I add customData: {
_token: ''
},

In tinymce4.php files.

@premier213
Copy link

this is not Work for laravel 5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants