Logging users out
Logging out a user ends their authenticated session, removing their access credentials from the device and requiring them to authenticate again to access protected resources.
Usage
To log a user out, use the logout
method from the usePrivy
hook:
Callbacks
You can attach callbacks to the logout process using the useLogout
hook:
Usage
To log a user out, use the logout
method from the usePrivy
hook:
Callbacks
You can attach callbacks to the logout process using the useLogout
hook:
Usage
To log a user out, use the logout
method from the usePrivy
hook:
Async Handling
Since logout
returns a Promise, you can await it to run code after the user has been logged out:
Usage
To log out an authenticated user, call the logout
method on the user object:
Example
Effect
This will clear the user state and delete the persisted user session.
Usage
To log out an authenticated user, call the logout
method:
Example
Effect
This will clear the user state and delete the persisted user session.