mirror of
https://github.com/typemill/typemill.git
synced 2025-07-31 19:30:40 +02:00
Version 1.4.6: Change content, CSRF-notification, fix blox editor, alert for raw editor, cyanine optimizations
This commit is contained in:
@@ -19,8 +19,14 @@ class RestrictApiAccess
|
||||
{
|
||||
if(!isset($_SESSION['login']) || !isset($_SESSION['role']))
|
||||
{
|
||||
return $response->withJson(['errors' => ['access denied']], 403);
|
||||
return $response->withJson(['data' => false, 'errors' => ['message' => 'You are probably logged out. Please login and try again.']], 403);
|
||||
}
|
||||
|
||||
# check csrf protection
|
||||
if( $request->getattribute('csrf_result') === false )
|
||||
{
|
||||
return $response->withJson(array('data' => false, 'errors' => ['message' => 'The form has a timeout. Please reload the page and try again.']), 403);
|
||||
}
|
||||
return $next($request, $response);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user