-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial work of authentication layer
- Loading branch information
Showing
24 changed files
with
725 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/Magnetar/Auth/Exceptions/AlreadyInitializedException.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Magnetar\Auth\Exceptions; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Exception thrown when an authentication storage adapter error occurs | ||
*/ | ||
class AuthStorageException extends Exception { | ||
|
||
} |
13 changes: 0 additions & 13 deletions
13
src/Magnetar/Auth/Exceptions/AuthenticationAdapterException.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Magnetar\Auth\Exceptions; | ||
|
||
use Exception; | ||
|
||
use Magnetar\Http\Response; | ||
|
||
/** | ||
* Exception thrown when a user fails an authentication protected request | ||
*/ | ||
class AuthorizationException extends Exception { | ||
/** | ||
* Response instance | ||
* @var Response | ||
*/ | ||
protected ?Response $response = null; | ||
|
||
/** | ||
* Set what response to return | ||
* @param Response|null $response The response instance | ||
* @return static | ||
*/ | ||
public function respondWith(?Response $response=null): static { | ||
$this->response = $response; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get the response instance | ||
* @return Response|null | ||
*/ | ||
public function getResponse(): ?Response { | ||
return $this->response; | ||
} | ||
} |
Oops, something went wrong.