BETTER-AUTH. UI
Mutations

useRevokeMultiSession

Revoke a device session in multi-session mode.

Refetches the device sessions list on success.

Usage

import {
  type MultiSessionAuthClient,
  useAuth,
  useRevokeMultiSession
} from "@better-auth-ui/react"

const { authClient } = useAuth()
const { mutate: revokeMultiSession } = useRevokeMultiSession(
  authClient as MultiSessionAuthClient
)

revokeMultiSession({ sessionToken: deviceSession.session.token })

useRevokeMultiSession requires the Better Auth multiSession plugin. Cast authClient to MultiSessionAuthClient so TypeScript picks up the plugin-extended method signature.

Options factory

import { revokeMultiSessionOptions } from "@better-auth-ui/react"
import { useMutation } from "@tanstack/react-query"

const { mutate } = useMutation(revokeMultiSessionOptions(authClient))

Params

Prop

Type

Last updated on

On this page