API Reference Client Functions Sign out of your Aura app and clear the current session.
The signOut client method signs out the current user: it invalidates the session token and clears the session cookie, from a client-side or browser context.
import { authClient } from "@/lib/auth-client"
const output = await authClient. signOut ({
redirectTo: "/login" ,
})
Parameter Type Required Description options SignOutOptionsNo An object containing additional options for the sign-out process.
Option Type Default Description redirect booleantrueWhether to redirect via window.location.assign (true) or return the result as an object (false). redirectTo stringundefined The URL to redirect to after sign-out completes.
Return Type Description Promise<SignOutReturn<Options>>Resolves to an object containing redirectURL, redirect, and success.
Cookies are cleared automatically in the browser context — you don't need to handle them manually.
The CSRF token is automatically loaded and sent with the request — you don't need to handle it manually.
The return value depends on the redirect option:
redirect: true (default) — navigates to redirectTo (or the default post-sign-out URL) via window.location.assign.
redirect: false — resolves to an object with redirectURL, redirect: false, and success, letting you handle navigation yourself.
If sign-out fails (e.g. missing or mismatched CSRF token, or no active session to invalidate), redirectURL resolves to null and success is false.
import { authClient } from "@/lib/auth-client"
const output = await authClient. signOut ({
redirectTo: "/login" ,
})
import { authClient } from "@/lib/auth-client"
const output = await authClient. signOut ({
redirect: false ,
redirectTo: "/login" ,
})
if (output.success) {
window.location. assign (output.redirectURL)
}