import type { Handle } from '@sveltejs/kit';

export const handle: Handle = async ({ event, resolve }) => {
  const response = await resolve(event);

  // Allow popups to use window.opener for Google Identity Services
  response.headers.set('Cross-Origin-Opener-Policy', 'same-origin-allow-popups');
  // Disable Cross-Origin-Embedder-Policy for this application
  response.headers.set('Cross-Origin-Embedder-Policy', 'unsafe-none');

  return response;
};
