mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(console): add post logout redirect uri in guides (#4356)
This commit is contained in:
parent
6651364fa7
commit
ec081d9740
2 changed files with 13 additions and 7 deletions
|
@ -141,22 +141,24 @@ To learn more about scopes and claims, see [Scopes and claims](https://github.co
|
||||||
|
|
||||||
<Step title="Implement the sign-out route">
|
<Step title="Implement the sign-out route">
|
||||||
|
|
||||||
To clean up the Python session and Logto session, a sign-out route can be implemented as follows:
|
To clean up the Python session and Logto session, we can designate a post sign-out redierct URI. This is where Logto will redirect users after they sign out.
|
||||||
|
|
||||||
|
<UriInputField name="postLogoutRedirectUris" />
|
||||||
|
|
||||||
|
And a sign-out route can be implemented as follows:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<code className="language-python">
|
<code className="language-python">
|
||||||
{`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
|
||||||
$client->signOut('${props.sampleUrls.origin}')
|
$client->signOut('${props.postLogoutRedirectUris[0] || props.sampleUrls.origin}')
|
||||||
);
|
);
|
||||||
});`}
|
});`}
|
||||||
</code>
|
</code>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
`postLogoutRedirectUri` is optional, and if not provided, the user will be redirected to a Logto default page after a successful sign-out (without redirecting back to your application).
|
The post sign-out redierct URI is optional, and if not provided, the user will be redirected to a Logto default page after a successful sign-out (without redirecting back to your application).
|
||||||
|
|
||||||
> The name `postLogoutRedirectUri` is from the [OpenID Connect RP-Initiated Logout](https://openid.net/specs/openid-connect-rpinitiated-1_0.html) specification. Although Logto uses "sign-out" instead of "logout", the concept is the same.
|
|
||||||
|
|
||||||
</Step>
|
</Step>
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,11 @@ To learn more about scopes and claims, see [Scopes and claims](https://github.co
|
||||||
|
|
||||||
<Step title="Implement the sign-out route">
|
<Step title="Implement the sign-out route">
|
||||||
|
|
||||||
To clean up the Python session and Logto session, a sign-out route can be implemented as follows:
|
To clean up the Python session and Logto session, we can designate a post sign-out redierct URI. This is where Logto will redirect users after they sign out.
|
||||||
|
|
||||||
|
<UriInputField name="postLogoutRedirectUris" />
|
||||||
|
|
||||||
|
And a sign-out route can be implemented as follows:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<code className="language-python">
|
<code className="language-python">
|
||||||
|
@ -166,7 +170,7 @@ To clean up the Python session and Logto session, a sign-out route can be implem
|
||||||
async def sign_out():
|
async def sign_out():
|
||||||
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
|
||||||
await client.signOut(postLogoutRedirectUri="${props.sampleUrls.origin}")
|
await client.signOut(postLogoutRedirectUri="${props.postLogoutRedirectUris[0] || props.sampleUrls.origin}")
|
||||||
)
|
)
|
||||||
`}
|
`}
|
||||||
</code>
|
</code>
|
||||||
|
|
Loading…
Reference in a new issue