0
Fork 0
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:
Gao Sun 2023-08-17 13:23:10 +08:00 committed by GitHub
parent 6651364fa7
commit ec081d9740
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View file

@ -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">
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>
<code className="language-python">
{`Route::get('/sign-out', function () {
return redirect(
// 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>
</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 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.
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).
</Step>

View file

@ -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">
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>
<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():
return redirect(
# 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>