BETTER-AUTH. UI
Mutations

useRevokeMultiSession

Revoke a device session in multi-session mode.

Refetches the device sessions list on success.

Usage

import { authClient } from "@/lib/auth-client"
import { useRevokeMultiSession } from "@better-auth-ui/react/plugins/multi-session"

const { mutate: revokeMultiSession } = useRevokeMultiSession(authClient)

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

useRevokeMultiSession requires the Better Auth multiSession plugin. Import your configured authClient. It already carries the plugin methods from createAuthClient.

Options factory

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

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

Params

Prop

Type

Last updated on

On this page