mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-02 11:40:47 +05:30
Update Slim example in auth-code docs
As it stands, if a user isn't familiar with Slim and they put both the Setup code and the Implementation example into a file, a request fails with: The implementation code implies the user has put the setup code into a Slim container - which they won't know they need to do. Instead, this doc update simply provides direct access to the that is configured in the Setup block - so everything can work as-is
This commit is contained in:
parent
6f0dc0c839
commit
dc17aa29ad
@ -95,10 +95,7 @@ _Please note: These examples here demonstrate usage with the Slim Framework; Sli
|
||||
The client will redirect the user to an authorization endpoint.
|
||||
|
||||
{% highlight php %}
|
||||
$app->get('/authorize', function (ServerRequestInterface $request, ResponseInterface $response) use ($app) {
|
||||
|
||||
/* @var \League\OAuth2\Server\AuthorizationServer $server */
|
||||
$server = $app->getContainer()->get(AuthorizationServer::class);
|
||||
$app->get('/authorize', function (ServerRequestInterface $request, ResponseInterface $response) use ($server) {
|
||||
|
||||
try {
|
||||
|
||||
@ -140,10 +137,7 @@ $app->get('/authorize', function (ServerRequestInterface $request, ResponseInter
|
||||
The client will request an access token using an authorization code so create an `/access_token` endpoint.
|
||||
|
||||
{% highlight php %}
|
||||
$app->post('/access_token', function (ServerRequestInterface $request, ResponseInterface $response) use ($app) {
|
||||
|
||||
/* @var \League\OAuth2\Server\AuthorizationServer $server */
|
||||
$server = $app->getContainer()->get(AuthorizationServer::class);
|
||||
$app->post('/access_token', function (ServerRequestInterface $request, ResponseInterface $response) use ($server) {
|
||||
|
||||
try {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user