Refresh Authentication
refreshAuth refreshes the current user’s authentication data from the server. This function fetches the latest user information and token from the backend, updating both the local user and token states with any changes.
Use this when you need to ensure the user’s authentication state is synchronized with the server, such as after making changes to the user’s account or when the token needs to be refreshed.
Usage
Parameters
Returns
Promise<VerifyResponse> - A promise that resolves to the verify response containing updated user and token data.
Examples
Basic usage
Listen to auth changes
In React, use useOnEvent from @dynamic-labs-sdk/react-hooks to subscribe to userChanged and tokenChanged — your components automatically re-render when refreshAuth fires those events. No manual listener setup needed in components. Last modified on June 24, 2026