I'm using Laravel 5. I have folder that references ckfinder in /public/plugins/ckfinder directory.
CheckAuthentication function in config.php is I need to use but session value and Auth Class is null.
I have tried
function CheckAuthentication(){
return Auth::check();
}
or
//Ckfinder Config.php
function CheckAuthentication(){
if($_SESSION['ckfinder_enabled'] == 'enabled') {
return true;
} else {
return false;
}
}
//App\Http\Middleware\Authenticate.php
public function handle($request, Closure $next)
{
if ($this->auth->guest()){
if ($request->ajax()){
return response('Unauthorized.', 401);
}else{
return redirect()->guest('auth/login');
}
}
if($this->auth->check()) {
$_SESSION['ckfinder_enabled'] = 'enabled';
return $next($request);
}
}