refactor: restrict WikiTree integration to the apps.wikitree.com domain and add helper utilities

This commit is contained in:
Przemek Więch
2026-07-05 20:35:44 +02:00
parent aeb73aced7
commit b285fe349f
6 changed files with 49 additions and 15 deletions

17
src/util/wikitree_util.ts Normal file
View File

@@ -0,0 +1,17 @@
/**
* Base URL for Topola Viewer hosted on apps.wikitree.com.
* WikiTree API calls only work when the app is served from this domain.
*/
export const WIKITREE_TOPOLA_URL =
'https://apps.wikitree.com/apps/wiech13/topola-viewer';
/**
* Returns true if the app is currently hosted on the apps.wikitree.com domain.
*
* WikiTree's API requires being served from this domain due to authentication
* and CORS restrictions. When not on this domain, WikiTree data loading does
* not work.
*/
export function isOnWikitreeDomain(): boolean {
return window.location.hostname === 'apps.wikitree.com';
}