Update the current session with new identity data or refresh the session.
The updateSession client method modifies or refreshes the data stored in the current user's session payload, without requiring them to sign out and back in.
Cookies are set automatically in the browser context — you don't need to handle them manually.
The CSRF token is automatically loaded and sent with the request — you don't need to handle it manually.
The session token's integrity is verified before applying the update. If the session is invalid or expired, the call resolves with success: false rather than throwing.
The return value depends on the redirect option:
redirect: true (default) — navigates to redirectTo (or the default post-update URL) via window.location.assign.
redirect: false — resolves to an object with the updated session, redirect: false, and success, letting you handle navigation yourself.
If the update fails (invalid session, or data that doesn't match identity.schema), success is false.