Auth\Db: add warning message with cause on initialization failure
This commit is contained in:
parent
fe19313c2f
commit
5ab7b35cc3
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue