Improved naming of authentication callback config key
This commit is contained in:
parent
62d02dacc0
commit
7f1cb9e8b2
@ -111,7 +111,7 @@ YOUR_HASHED_PASSWORD = password_hash('my super strong password', PASSWORD_DEFAUL
|
|||||||
use Taproot\IndieAuth;
|
use Taproot\IndieAuth;
|
||||||
$server = new IndieAuth\Server([
|
$server = new IndieAuth\Server([
|
||||||
…
|
…
|
||||||
'handleAuthenticationRequestCallback' => new IndieAuth\Callback\SingleUserPasswordAuthenticationCallback(
|
'authenticationHandler' => new IndieAuth\Callback\SingleUserPasswordAuthenticationCallback(
|
||||||
['me' => 'https://me.example.com/'],
|
['me' => 'https://me.example.com/'],
|
||||||
YOUR_HASHED_PASSWORD
|
YOUR_HASHED_PASSWORD
|
||||||
)
|
)
|
||||||
|
@ -107,7 +107,7 @@ $server = new Taproot\IndieAuth\Server([
|
|||||||
|
|
||||||
// An authentication callback function, which either returns data about the current user,
|
// An authentication callback function, which either returns data about the current user,
|
||||||
// or redirects to/implements an authentication flow.
|
// or redirects to/implements an authentication flow.
|
||||||
'handleAuthenticationRequestCallback' => function (ServerRequestInterface $request, string $authenticationRedirect, ?string $normalizedMeUrl) {
|
'authenticationHandler' => function (ServerRequestInterface $request, string $authenticationRedirect, ?string $normalizedMeUrl) {
|
||||||
// If the request is authenticated, return an array with a `me` key containing the
|
// If the request is authenticated, return an array with a `me` key containing the
|
||||||
// canonical URL of the currently logged-in user.
|
// canonical URL of the currently logged-in user.
|
||||||
if ($userUrl = getLoggedInUserUrl($request)) {
|
if ($userUrl = getLoggedInUserUrl($request)) {
|
||||||
@ -210,7 +210,7 @@ documentation for both handling methods for further documentation about them.</p
|
|||||||
<dt class="phpdocumentor-table-of-contents__entry -constant -public">
|
<dt class="phpdocumentor-table-of-contents__entry -constant -public">
|
||||||
<a href="classes/Taproot-IndieAuth-Server.html#constant_HANDLE_AUTHENTICATION_REQUEST">HANDLE_AUTHENTICATION_REQUEST</a>
|
<a href="classes/Taproot-IndieAuth-Server.html#constant_HANDLE_AUTHENTICATION_REQUEST">HANDLE_AUTHENTICATION_REQUEST</a>
|
||||||
<span>
|
<span>
|
||||||
= 'handleAuthenticationRequestCallback' </span>
|
= 'authenticationHandler' </span>
|
||||||
</dt>
|
</dt>
|
||||||
<dd></dd>
|
<dd></dd>
|
||||||
|
|
||||||
@ -434,7 +434,7 @@ documentation for both handling methods for further documentation about them.</p
|
|||||||
<span class="phpdocumentor-signature__visibility">public</span>
|
<span class="phpdocumentor-signature__visibility">public</span>
|
||||||
<span class="phpdocumentor-signature__type">mixed</span>
|
<span class="phpdocumentor-signature__type">mixed</span>
|
||||||
<span class="phpdocumentor-signature__name">HANDLE_AUTHENTICATION_REQUEST</span>
|
<span class="phpdocumentor-signature__name">HANDLE_AUTHENTICATION_REQUEST</span>
|
||||||
= <span class="phpdocumentor-signature__default-value">'handleAuthenticationRequestCallback'</span>
|
= <span class="phpdocumentor-signature__default-value">'authenticationHandler'</span>
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ use function Taproot\IndieAuth\renderTemplate;
|
|||||||
* use Taproot\IndieAuth;
|
* use Taproot\IndieAuth;
|
||||||
* $server = new IndieAuth\Server([
|
* $server = new IndieAuth\Server([
|
||||||
* …
|
* …
|
||||||
* 'handleAuthenticationRequestCallback' => new IndieAuth\Callback\SingleUserPasswordAuthenticationCallback(
|
* 'authenticationHandler' => new IndieAuth\Callback\SingleUserPasswordAuthenticationCallback(
|
||||||
* ['me' => 'https://me.example.com/'],
|
* ['me' => 'https://me.example.com/'],
|
||||||
* YOUR_HASHED_PASSWORD
|
* YOUR_HASHED_PASSWORD
|
||||||
* )
|
* )
|
||||||
|
@ -39,7 +39,7 @@ use Taproot\IndieAuth\Storage\TokenStorageInterface;
|
|||||||
*
|
*
|
||||||
* // An authentication callback function, which either returns data about the current user,
|
* // An authentication callback function, which either returns data about the current user,
|
||||||
* // or redirects to/implements an authentication flow.
|
* // or redirects to/implements an authentication flow.
|
||||||
* 'handleAuthenticationRequestCallback' => function (ServerRequestInterface $request, string $authenticationRedirect, ?string $normalizedMeUrl) {
|
* 'authenticationHandler' => function (ServerRequestInterface $request, string $authenticationRedirect, ?string $normalizedMeUrl) {
|
||||||
* // If the request is authenticated, return an array with a `me` key containing the
|
* // If the request is authenticated, return an array with a `me` key containing the
|
||||||
* // canonical URL of the currently logged-in user.
|
* // canonical URL of the currently logged-in user.
|
||||||
* if ($userUrl = getLoggedInUserUrl($request)) {
|
* if ($userUrl = getLoggedInUserUrl($request)) {
|
||||||
@ -77,7 +77,7 @@ use Taproot\IndieAuth\Storage\TokenStorageInterface;
|
|||||||
*/
|
*/
|
||||||
class Server {
|
class Server {
|
||||||
const HANDLE_NON_INDIEAUTH_REQUEST = 'handleNonIndieAuthRequestCallback';
|
const HANDLE_NON_INDIEAUTH_REQUEST = 'handleNonIndieAuthRequestCallback';
|
||||||
const HANDLE_AUTHENTICATION_REQUEST = 'handleAuthenticationRequestCallback';
|
const HANDLE_AUTHENTICATION_REQUEST = 'authenticationHandler';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The query string parameter key used for storing the hash used for validating authorization request parameters.
|
* The query string parameter key used for storing the hash used for validating authorization request parameters.
|
||||||
|
Reference in New Issue
Block a user