import auth from '@/services/auth';

export const getRedirectUrl = async () => {
	const url = new URL(window.location.href);
	const redirect = url.searchParams.get('redirect');

	const { data, success } = await auth.userAuth.getRedirectUrl({
		redirect: redirect || '',
	});

	if (success && data) {
		window.location.href = data;
	}
};
