BETTER-AUTH. UI
Mutations

useRevokeSession

Revoke an active session (sign out another device).

Refetches the sessions list on success.

Usage

import { authClient } from "@/lib/auth-client"
import { useRevokeSession } from "@better-auth-ui/react"

const { mutate: revokeSession } = useRevokeSession(authClient)

revokeSession({ token: session.token })

Options factory

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

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

Params

Prop

Type

Last updated on

On this page