Returns a logout function that clears the token in context and sends DELETE to the auth endpoint with credentials.
The token is cleared immediately (optimistic), and the DELETE request runs in the background.
Returns (data?:object)=>Promise<void>
A function (data?) => Promise<void>. Call with optional body (forwarded to the server's onLogout callback). Token is cleared immediately.
Returns a logout function that clears the token in context and sends DELETE to the auth endpoint with credentials. The token is cleared immediately (optimistic), and the DELETE request runs in the background.