Beispiel #1
0
 public function checkCsrf()
 {
     if (Koala::getEnv('csrf')) {
         $token = koala::$app->cookie->get('__csrf__');
         $post = $this->post(['__csrf__' => '']);
         if ($post['__csrf__'] != $token) {
             throw new KoalaException("csrf");
         }
     }
 }