diff --git a/src/gui/src/initgui.js b/src/gui/src/initgui.js index 6717ac9ef..d8739a0e1 100644 --- a/src/gui/src/initgui.js +++ b/src/gui/src/initgui.js @@ -151,6 +151,201 @@ if(jQuery){ }; } +/** + * Shows a Turnstile challenge modal for first-time temp user creation + * @param {Object} options - Configuration options + * @param {Function} options.onSuccess - Callback when challenge is completed successfully + * @param {Function} options.onError - Callback when challenge fails + */ +window.showTurnstileChallenge = function(options) { + return new Promise((resolve) => { + const modalId = 'turnstile-challenge-modal'; + const siteKey = window.gui_params?.turnstileSiteKey; + + if (!siteKey) { + options.onError('Turnstile site key not configured'); + return resolve(); + } + + // Create modal HTML + let modalHtml = ` +