Logout / Revoke Session
revokeSession
function: API Reference
session.revokeSession()
- This function deletes the session from the database and clears relevant auth cookies
- If using blacklisting, this will immediately invalidate the JWT access token.
Example
import io.supertokens.javalin.*;
app.before("/logout", SuperTokens.middleware());
app.use("/logout", ctx -> {
SuperTokens.getFromContext(ctx).revokeSession();
ctx.result("Success! Go to login page");
});