Skip to main content

Sign out

The signOut method revokes the session on the frontend and backend.

import React from "react";import { signOut } from "supertokens-auth-react/recipe/session";
function NavBar() {  async function 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.
What type of UI do you want to use?
Custom UI
Pre built UI