Skip to content

Commit

Permalink
Merge pull request #7 from logto-io/yemq-update-php-samples
Browse files Browse the repository at this point in the history
chore: update samples to align with docs.logto.io use case
  • Loading branch information
darcyYe authored Feb 2, 2024
2 parents c7cf241 + 1d109f4 commit 3d6a773
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
},
"scripts": {
"dev": ["Composer\\Config::disableProcessTimeout", "php -S localhost:5000 -t samples"],
"dev": ["Composer\\Config::disableProcessTimeout", "php -S localhost:8080 -t samples"],
"test": "phpunit tests",
"docs": "rm -rf docs/api && php phpDocumentor.phar && prettier --write docs/api"
},
Expand Down
33 changes: 17 additions & 16 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ This tutorial will show you how to integrate Logto into your PHP web application

## Table of contents

- [Table of contents](#table-of-contents)
- [Installation](#installation)
- [Integration](#integration)
- [Init LogtoClient](#init-logtoclient)
- [Implement the sign-in route](#implement-the-sign-in-route)
- [Implement the callback route](#implement-the-callback-route)
- [Implement the home page](#implement-the-home-page)
- [Implement the sign-out route](#implement-the-sign-out-route)
- [Checkpoint: Test your application](#checkpoint-test-your-application)
- [Protect your routes](#protect-your-routes)
- [Scopes and claims](#scopes-and-claims)
- [Special ID token claims](#special-id-token-claims)
- [API resources](#api-resources)
- [Configure Logto client](#configure-logto-client)
- [Fetch access token for the API resource](#fetch-access-token-for-the-api-resource)
- [Fetch organization token for user](#fetch-organization-token-for-user)
- [Logto PHP SDK tutorial](#logto-php-sdk-tutorial)
- [Table of contents](#table-of-contents)
- [Installation](#installation)
- [Integration](#integration)
- [Init LogtoClient](#init-logtoclient)
- [Implement the sign-in route](#implement-the-sign-in-route)
- [Implement the callback route](#implement-the-callback-route)
- [Implement the home page](#implement-the-home-page)
- [Implement the sign-out route](#implement-the-sign-out-route)
- [Checkpoint: Test your application](#checkpoint-test-your-application)
- [Protect your routes](#protect-your-routes)
- [Scopes and claims](#scopes-and-claims)
- [Special ID token claims](#special-id-token-claims)
- [API resources](#api-resources)
- [Configure Logto client](#configure-logto-client)
- [Fetch access token for the API resource](#fetch-access-token-for-the-api-resource)
- [Fetch organization token for user](#fetch-organization-token-for-user)

## Installation

Expand Down
6 changes: 3 additions & 3 deletions samples/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@
break;

case '/sign-in':
header('Location: ' . $client->signIn("http://localhost:5000/callback"));
header('Location: ' . $client->signIn("http://localhost:8080/sign-in-callback"));
exit();

case '/callback':
case '/sign-in-callback':
$client->handleSignInCallback();
header('Location: /');
exit();

case '/sign-out':
$to = $client->signOut('http://localhost:5000/');
$to = $client->signOut('http://localhost:8080');
header("Location: $to");
exit();

Expand Down

0 comments on commit 3d6a773

Please sign in to comment.