const require_InvalidParamError = require('./InvalidParamError-Cs4ZMEj4.cjs');
const require_getWalletProviderByKey = require('./getWalletProviderByKey-OD65GUWG.cjs');

//#region src/modules/user/refreshAuth/refreshAuth.ts
/**
* Refreshes the current user's data from the server.
*
* This function fetches the latest user information and token from the backend
* updating the local user and token states with any changes.
*
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
* @returns A promise that resolves to the verify response.
* @instrumented
* @redact-params
*/
const refreshAuth = async (client = require_InvalidParamError.getDefaultClient()) => {
	const core = require_InvalidParamError.getCore(client);
	const response = await require_InvalidParamError.createApiClient({}, client).refreshAuth({ environmentId: core.environmentId });
	require_getWalletProviderByKey.updateAuthFromVerifyResponse({ response }, client);
	return response;
};
const __refreshAuth_impl = refreshAuth;
const __refreshAuth_wrapped = require_InvalidParamError.instrumentFunction({
	fn: __refreshAuth_impl,
	functionName: "refreshAuth",
	getCore: () => {
		try {
			return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
		} catch {
			return;
		}
	},
	redactAll: true
});

//#endregion
Object.defineProperty(exports, '__refreshAuth_wrapped', {
  enumerable: true,
  get: function () {
    return __refreshAuth_wrapped;
  }
});
//# sourceMappingURL=refreshAuth-B3XSU6GT.cjs.map