Skip to content

Commit

Permalink
add hasToken method (#351)
Browse files Browse the repository at this point in the history
* add method to determine whether token exists or we need to re-authenticate

* document on the facade
  • Loading branch information
macbookandrew authored Sep 1, 2024
1 parent 64f76d3 commit 4a229c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Omniphx/Forrest/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,16 @@ public function getToken()
return $this->tokenRepo->get();
}

/**
* Determine whether token exists
*
* @return bool
*/
public function hasToken()
{
return $this->tokenRepo->has();
}

/**
* Returns any resource that is available to the authenticated
* user. Reference Force.com's REST API guide to read about more
Expand Down
3 changes: 2 additions & 1 deletion src/Omniphx/Forrest/Providers/Laravel/Facades/Forrest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @method static \Illuminate\Http\RedirectResponse|void authenticate()
* @method static void refresh()
* @method static \Psr\Http\Message\ResponseInterface|void revoke()
* @method static bool hasToken()
* @method static void setCredentials(array $credentials)
* @method static string|array versions(array $options = [])
* @method static string|array resources(array $options = [])
Expand Down Expand Up @@ -55,7 +56,7 @@
* @method static string|array actions(string $resource, array $options = [])
* @method static string|array support(string $resource, array $options = [])
* @method static \Omniphx\Forrest\Interfaces\RedirectInterface callback()
*/
*/
class Forrest extends Facade
{
/**
Expand Down

0 comments on commit 4a229c9

Please sign in to comment.