Reauthenticate without reloading the page or losing state
Sometimes it’s helpful to reauthenticate users, for example after a logged out user has signed into your application, and you wish to display their details.
How to reauthenticate
By calling
room.reconnect
you can
reconnect and reauthenticate your collaborative application without refreshing
the page or unmounting the
RoomProvider
component.
Using this method will preserve the current client’s state, such as the
undo/redo history.
In React
In our React package, you can retrieve the current room with the
useRoom
hook, before calling
room.reconnect
from there.