cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CDC WebSDK configuration not loading

vromeo
Explorer
0 Kudos

Hi there,

I have created a parent site with a single child and put some JS logic in the parent's WebSDK configuration.

Then I created a simple web page and correctly referenced the Gigya library (based on the child ApiKey).

When the page loads, the logic inside the WebSDK configuration does not fire. I have tried simply adding a console.log() but nothing,

Could you please help me?

Thanks,

Valerio

View Entire Topic
shemma
Advisor
Advisor
0 Kudos

Hi,

Can you please share the code you are using.

vromeo
Explorer
0 Kudos
Hi shemma,
vromeo
Explorer
0 Kudos
this is the code in the parent site:
vromeo
Explorer
0 Kudos

this is the code in the parent site:

{
    // A comma-delimited list of provider names to enable.
    enabledProviders: '*',

    // Define the language of Gigya's user interface and error message.
    lang: 'en',

    // Bind globally to events.
    customEventMap: {
        eventMap: [{
            events: '*',
            args: [function(e) {
                return e;
            }],
            method: function(e) {
            
            	console.log(e);
            
                if (e.fullEventName === 'login') {
                    // Handle login event here.
                } else if (e.fullEventName === 'logout') {
                    // Handle logout event here.
                }
                
                //START RESET PWD HANDLING
                function getParameterByName(name) {
                    var url = window.location.href;
                    name = name.replace(/[\[\]]/g, '\\$&');
                    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
                        results = regex.exec(url);
                    if (!results) return null;
                    if (!results[2]) return '';
                    return decodeURIComponent(results[2].replace(/\+/g, ' '));
                }

                function removeParams() {
                    window.history.pushState({}, document.title, "/");
                }

                window.gigya_custom_screen_shown = window.gigya_custom_screen_shown || false;
                
                if (getParameterByName("forgotPwd") && window.gigya_custom_screen_shown === false) {
                
                    window.gigya_custom_screen_shown = true;
                    gigya.accounts.showScreenSet({
                        screenSet: 'Default-RegistrationLogin',
                        startScreen: 'gigya-forgot-password-screen',
                        onAfterSubmit: function(pwdSubmit) {
                            if (pwdSubmit.response.status !== "FAIL") {
                                removeParams();
                            }
                        }
                    });
                }
                //END RESET PWD HANDLING
            }
        }]
    }
}

I tried just adding a console.log but it doesn't work. Could it depend on the parent/child configuration?