Skip to content

Documentation / react-auth / useLogout

Function: useLogout()

useLogout(callbacks?): Object

Use this hook to log the user out, and to attach a callback after a successful logout.

Parameters

callbacks?: Object

callbacks.onSuccess?: () => void

Callback that will execute when a user successfully logs out.

Returns

Object

logout - logs the user out and clears their authentication state.

logout

logout: () => Promise<void>

Returns

Promise<void>