Skip to content

Commit 4a229c9

Browse files
add hasToken method (#351)
* add method to determine whether token exists or we need to re-authenticate * document on the facade
1 parent 64f76d3 commit 4a229c9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Omniphx/Forrest/Client.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,16 @@ public function getToken()
719719
return $this->tokenRepo->get();
720720
}
721721

722+
/**
723+
* Determine whether token exists
724+
*
725+
* @return bool
726+
*/
727+
public function hasToken()
728+
{
729+
return $this->tokenRepo->has();
730+
}
731+
722732
/**
723733
* Returns any resource that is available to the authenticated
724734
* user. Reference Force.com's REST API guide to read about more

src/Omniphx/Forrest/Providers/Laravel/Facades/Forrest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @method static \Illuminate\Http\RedirectResponse|void authenticate()
99
* @method static void refresh()
1010
* @method static \Psr\Http\Message\ResponseInterface|void revoke()
11+
* @method static bool hasToken()
1112
* @method static void setCredentials(array $credentials)
1213
* @method static string|array versions(array $options = [])
1314
* @method static string|array resources(array $options = [])
@@ -55,7 +56,7 @@
5556
* @method static string|array actions(string $resource, array $options = [])
5657
* @method static string|array support(string $resource, array $options = [])
5758
* @method static \Omniphx\Forrest\Interfaces\RedirectInterface callback()
58-
*/
59+
*/
5960
class Forrest extends Facade
6061
{
6162
/**

0 commit comments

Comments
 (0)