BETTER-AUTH. UI
Mutations

useRevokeSession

Revoke an active session (sign out another device).

Refetches the sessions list on success.

Usage

import { useAuth, useRevokeSession } from "@better-auth-ui/react"

const { authClient } = useAuth()
const { mutate: revokeSession } = useRevokeSession(authClient)

revokeSession({ token: session.token })

Options factory

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

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

Params

Prop

Type

Last updated on

On this page