<?php

namespace Config;

use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Filters\CSRF;
use CodeIgniter\Filters\DebugToolbar;
use CodeIgniter\Filters\Honeypot;

class Filters extends BaseConfig
{
	/**
	 * Configures aliases for Filter classes to
	 * make reading things nicer and simpler.
	 *
	 * @var array
	 */
	public $aliases = [
		'csrf'     => CSRF::class,
		'toolbar'  => DebugToolbar::class,
		'honeypot' => Honeypot::class,
		'login'      => \Myth\Auth\Filters\LoginFilter::class,
		'role'       => \Myth\Auth\Filters\RoleFilter::class,
		'permission' => \Myth\Auth\Filters\PermissionFilter::class,
	    'cors' 	   => \App\Filters\CorsFilter::class,
//	    'login' 	   => \App\Filters\LoginFilter::class,


	];

	/**
	 * List of filter aliases that are always
	 * applied before and after every request.
	 *
	 * @var array
	 */
	public $globals = [
		'before' => [
			'cors'=>['except'=>['/api/*']],
			'honeypot',
			'login'  => ['except'=>['/','ptampilkan','tampilkanw/*','ceknik','kirimkandetil','batalpesan','cekkoded','cekkoded/*','hitungkuota','swa/*','swa','kirimkan','scan','/cetaketiket/*','/etiketcetak/*','/cekdata','qr','/QrBarcode/*','cekqr','cekqr/*','/swastatus','/swastatus/*','/swastatus2/*','/parse_error/*','/swastatus3/*','/testpeda','/testpeda/*','kelamincombo','/tujuancombo/1','/tujuancombo','/swadaftar','/swadaftar/*','/swadaftartest/*','/swadaftarsukses/*','/ujipedamateng','/swadaftartest','/swastatustest','/swadaftarsuksestest/*','/swastatus2test','/swastatus3test']],
          	'role',
			'permission',
			'csrf',
		],
		'after'  => [
//			'toolbar',
		 	'honeypot',
//			'DebugToolbar',

		],
	];

	/**
	 * List of filter aliases that works on a
	 * particular HTTP method (GET, POST, etc.).
	 *
	 * Example:
	 * 'post' => ['csrf', 'throttle']
	 *
	 * @var array
	 */
	public $methods = [];

	/**
	 * List of filter aliases that should run on any
	 * before or after URI patterns.
	 *
	 * Example:
	 * 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
	 *
	 * @var array
	 */
	public $filters = [];
}
