import { A as createApiClient, ct as getCore, it as getDefaultClient, q as instrumentFunction } from "./InvalidParamError-BmFmxeXx.esm.js";
import { r as updateAuthFromVerifyResponse } from "./getWalletProviderByKey-AQmQQpmk.esm.js";

//#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 = getDefaultClient()) => {
	const core = getCore(client);
	const response = await createApiClient({}, client).refreshAuth({ environmentId: core.environmentId });
	updateAuthFromVerifyResponse({ response }, client);
	return response;
};
const __refreshAuth_impl = refreshAuth;
const __refreshAuth_wrapped = instrumentFunction({
	fn: __refreshAuth_impl,
	functionName: "refreshAuth",
	getCore: () => {
		try {
			return getCore(getDefaultClient());
		} catch {
			return;
		}
	},
	redactAll: true
});

//#endregion
export { __refreshAuth_wrapped as t };
//# sourceMappingURL=refreshAuth-D8dU3BLP.esm.js.map