mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
chore(console): update php and python guide (#4964)
This commit is contained in:
parent
15278302f3
commit
e49e92fb6f
2 changed files with 3 additions and 1 deletions
|
@ -147,7 +147,7 @@ To clean up the Python session and Logto session, we can designate a post sign-o
|
||||||
And a sign-out route can be implemented as follows:
|
And a sign-out route can be implemented as follows:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<code className="language-python">
|
<code className="language-php">
|
||||||
{`Route::get('/sign-out', function () {
|
{`Route::get('/sign-out', function () {
|
||||||
return redirect(
|
return redirect(
|
||||||
// Redirect the user to the home page after a successful sign-out
|
// Redirect the user to the home page after a successful sign-out
|
||||||
|
|
|
@ -199,6 +199,8 @@ Now, you can test your application:
|
||||||
Now, you have a working sign-in flow, but your routes are still unprotected. Per the framework you use, you can create a decorator such as `@authenticated` to protect your routes. For example:
|
Now, you have a working sign-in flow, but your routes are still unprotected. Per the framework you use, you can create a decorator such as `@authenticated` to protect your routes. For example:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from functools import wraps
|
||||||
|
|
||||||
def authenticated(func):
|
def authenticated(func):
|
||||||
@wraps(func)
|
@wraps(func)
|
||||||
async def wrapper(*args, **kwargs):
|
async def wrapper(*args, **kwargs):
|
||||||
|
|
Loading…
Add table
Reference in a new issue