ckfinder / ckfinder-laravel-package

CKFinder 3 package for Laravel
Other
157 stars 89 forks source link

Laravel 5.8 integration #21

Open ducit1995 opened 5 years ago

ducit1995 commented 5 years ago

i did try custom Middleware with Auth of laravel but Auth always return null . if (\Auth::check()) { config(['ckfinder.authentication' => function () use ($request) { return true; }]); } else config(['ckfinder.authentication' => function () use ($request) { return false; }]); }

antking1109 commented 5 years ago

I also have the same problem

aaadkins commented 5 years ago

Same situation here. I am trying to setup the private folders for each user however I can never get the current Auth::user it always returns null. Is there another way to get the current user in middleware or the config file?

ducit1995 commented 5 years ago

I also have the same problem

Same situation here. I am trying to setup the private folders for each user however I can never get the current Auth::user it always returns null. Is there another way to get the current user in middleware or the config file?

now i did fix it by sesssion :D

aaadkins commented 5 years ago

I also have the same problem

Same situation here. I am trying to setup the private folders for each user however I can never get the current Auth::user it always returns null. Is there another way to get the current user in middleware or the config file?

now i did fix it by sesssion :D

Can you explain a bit more how you are using the session to solve this? When I try to call the session in my middleware it shows up empty as well. Thanks

ducit1995 commented 5 years ago

I also have the same problem

Same situation here. I am trying to setup the private folders for each user however I can never get the current Auth::user it always returns null. Is there another way to get the current user in middleware or the config file?

now i did fix it by sesssion :D

Can you explain a bit more how you are using the session to solve this? When I try to call the session in my middleware it shows up empty as well. Thanks

1 . when login i set seesion for this user if (Auth::attempt(['email' => $email, 'password' => $password, 'role' => $role_admin)) { session_start(); $_SESSION["is_login"] = true; } 2 . in file config.php of ckfinder i replace old code to . $config['authentication'] = function () { session_start(); if (!empty($_SESSION["is_login"])) { return true; } else { return false; } };