Skip to content

Commit

Permalink
Added insideauth_booted function
Browse files Browse the repository at this point in the history
  • Loading branch information
nahime0 committed Apr 2, 2023
1 parent 382ad85 commit 71c84e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions functions/insideauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ function insideauth(): Authenticator
{
return InsideAuth::current();
}

function insideauth_booted(): bool
{
return InsideAuth::booted();
}
7 changes: 6 additions & 1 deletion src/Registrators/Registrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class Registrator
* It will be populate by the InjectIntoApplication middleware
* @see \Illegal\InsideAuth\Http\Middleware\InjectIntoApplication
*/
private Authenticator $current;
private ?Authenticator $current = null;

/**
* The registrators list, used to register the routes, the middlewares, the config, etc.
Expand Down Expand Up @@ -101,4 +101,9 @@ public function current(): Authenticator
{
return $this->current;
}

public function booted(): bool
{
return filled($this->current);
}
}

0 comments on commit 71c84e3

Please sign in to comment.