# Session revocation

> session_active() for restrictive policies: false once the caller's session was signed out or expired, or the user was banned or deleted, so revoked access tokens stop working before they expire. options.policies writes the policy on every table.

- Category: Identity & access
- Module: `session-revocation`
- Modes: `managed`
- Docs: https://bettersupabase.com/docs/blocks/sql
- Page: https://bettersupabase.com/blocks/session-revocation

## Install

```bash
npx better-supabase add session-revocation
```

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Modes: "managed". The default is "managed".
    "session-revocation": { mode: "managed" },
  },
});
```

## Client

The React hooks are in `better-supabase/blocks/session-revocation/react`. They return data and actions and render no UI. Source: https://github.com/ScaleDockHQ/better-supabase/blob/main/packages/better-supabase/src/blocks/session-revocation/react/index.ts

## Recipes

- [Sessions list](https://bettersupabase.com/recipes/sessions-list.md): The caller's signed-in devices with the last activity and a button to end each session.
