diff --git a/src/Auth/Db.php b/src/Auth/Db.php index 101413b..3f6ca9e 100644 --- a/src/Auth/Db.php +++ b/src/Auth/Db.php @@ -84,6 +84,10 @@ class Db extends Backend { ) ); self :: $dsn = App::get('auth.db.dsn', null, 'string'); + if (!self :: $dsn) { + Log :: warning('No database DSN configured, can not initialize this authentication backend'); + return false; + } self :: $user = App::get('auth.db.user', null, 'string'); self :: $password = App::get('auth.db.password', null, 'string'); self :: $options = App::get('auth.db.options', null, 'array'); @@ -91,7 +95,7 @@ class Db extends Backend { self :: $username_field = App::get('auth.db.username_field', null, 'string'); self :: $password_field = App::get('auth.db.password_field', null, 'string'); self :: $exposed_fields = App::get('auth.db.exposed_fields', null, 'array'); - return boolval(self :: $dsn); + return true; } /**