-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
LoginAttempting
event for customizing authorization parameters (#…
…382)
- Loading branch information
Showing
4 changed files
with
72 additions
and
10 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 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,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Auth0\Laravel\Contract\Event\Stateful; | ||
|
||
interface LoginAttempting | ||
{ | ||
/** | ||
* @param array $parameters The login parameters array. | ||
*/ | ||
public function __construct( | ||
array $parameters = [], | ||
); | ||
|
||
/** | ||
* Returns the login parameters array. | ||
*/ | ||
public function getParameters(): array; | ||
|
||
/** | ||
* Replace the login parameters array. | ||
* | ||
* @param array $parameters | ||
*/ | ||
public function setParameters(array $parameters): self; | ||
} |
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Auth0\Laravel\Event\Stateful; | ||
|
||
use Auth0\Laravel\Contract\Event\Stateful\LoginAttempting as LoginAttemptingContract; | ||
use Auth0\Laravel\Event\Auth0Event; | ||
|
||
final class LoginAttempting extends Auth0Event implements LoginAttemptingContract | ||
{ | ||
public function __construct( | ||
private array $parameters = [], | ||
) { | ||
} | ||
|
||
public function getParameters(): array | ||
{ | ||
return $this->parameters; | ||
} | ||
|
||
public function setParameters(array $parameters): self | ||
{ | ||
$this->parameters = $parameters; | ||
|
||
return $this; | ||
} | ||
} |
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