Sign out
The signOut
method revokes the session for the user.
import { signOut } from "supertokens-auth-react/recipe/emailpassword";
function NavBar () {
function async onLogout () {
await signOut();
window.location.href = "/";
}
return (
<ul>
<li>Home</li>
<li onClick={onLogout}>Logout</li>
</ul>
)
}
- We do not provide any UI for a Sign-out button
- On success, the
signOut
function does not redirect the user to another page.
Please make sure to implement the above yourself ๐