private function check($config, $type)
{
if (empty($config)) {
throw new Exception($type . ' methods arent initialized yet in config');
}
$auth = Utility::normalize($config);
foreach ($auth as $method => $config) {
$method = "_" . ucfirst($method) . ucfirst($type);
if (!method_exists(__CLASS__, $method)) {
throw new Exception('Auth Method doesnt exists: ' . $method);
}
if ($this->{$method}($config) === false) {
return false;
}
}
return true;
}