K
K
kosmok2020-01-01 12:39:56
Laravel
kosmok, 2020-01-01 12:39:56

Laravel 8 Ckeditor5 validating authentication?

Hello, I have such a space, I installed Ckeditor 5 on laravel 8 and so in the file (ckfinder) config.php there is $config['authentication']. authentication'] == true and in other cases false. I tried via Auth it doesn't work

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
smatDnepr, 2021-01-07
@smatDnepr

Try this option:

$config['authentication'] = function () {
  require $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
  $app = require_once  $_SERVER['DOCUMENT_ROOT']. '/bootstrap/app.php';
  $request = Illuminate\Http\Request::capture();
  $request->setMethod('GET');
  $app->make('Illuminate\Contracts\Http\Kernel')->handle($request);
  if (Auth::check() && Auth::user()->is_admin ) {
    return true;
  } else {
    header('HTTP/1.0 403 Forbidden');
    exit();
  }
};

O
on_click, 2020-01-02
@on_click

If I understand everything correctly, then this link will help you
5fefad22c5c27249783389.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question