Skip to content

Commit

Permalink
feat: switch auth to new leaf DI
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Aug 14, 2024
1 parent cacbf18 commit e441aba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
*/
function auth()
{
if (!(\Leaf\Config::get('auth.instance'))) {
\Leaf\Config::set('auth.instance', new Leaf\Auth());
if (!(\Leaf\Config::getStatic('auth'))) {
\Leaf\Config::singleton('auth', function () {
return new \Leaf\Auth();
});
}

return \Leaf\Config::get('auth.instance');
return \Leaf\Config::getStatic('auth');
}
}

Expand Down

0 comments on commit e441aba

Please sign in to comment.