split authentication required and secured controllers
This commit is contained in:
6 files changed
+45
-37
No files matched your search
@@ -4,14 +4,14 @@ use DateTime;
|
||||
use RVR\PersistentData\Model\OAuthToken;
|
||||
use RVR\PersistentData\Model\User;
|
||||
use RVR\Repository\OAuthClientRepository;
|
||||
use SokoWeb\Interfaces\Authorization\ISecured;
|
||||
use SokoWeb\Interfaces\Authentication\IAuthenticationRequired;
|
||||
use SokoWeb\Interfaces\Request\IRequest;
|
||||
use SokoWeb\Interfaces\Response\IRedirect;
|
||||
use SokoWeb\Response\Redirect;
|
||||
use SokoWeb\PersistentData\PersistentDataManager;
|
||||
use SokoWeb\Response\HtmlContent;
|
||||
|
||||
class OAuthAuthController implements ISecured
|
||||
class OAuthAuthController implements IAuthenticationRequired
|
||||
{
|
||||
private IRequest $request;
|
||||
|
||||
@@ -26,9 +26,9 @@ class OAuthAuthController implements ISecured
|
||||
$this->oAuthClientRepository = new OAuthClientRepository();
|
||||
}
|
||||
|
||||
public function authorize(): bool
|
||||
public function isAuthenticationRequired(): bool
|
||||
{
|
||||
return $this->request->user() !== null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function auth()
|
||||
|
||||
Reference in new issue
Block a user