0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/console/public/get-started/application/react/zh-cn/step4.md

26 lines
573 B
Markdown
Raw Normal View History

---
title: 登出
subtitle: 1 steps
---
Execute signOut() methods will redirect users to the Logto sign out page. After a success sign out, all use session data and auth status will be cleared.
```postLogoutRedirectUris
Post sign out redirect URI
```
Add the following code to your web app
```typescript
import React from "react";
import { useLogto } from '@logto/react';
const SignOutButton = () => {
const { signOut } = useLogto();
return (
<button onClick={() => signOut(window.location.origin)}>Sign out</button>
);
};
export default SignOutButton;
```