NodeJS post_process scripting for user/session example - Error 500


#1

Hi everyone,

I’m trying to append some extra data on user session object after user login, but somehow DF keeps returning 500 error after I call the api.
This is simple code, but I don’t know why it’s breaking.

var url = 'mysql/_table/extra_data/';
if(event.response.status_code === 200) {

    if (platform.session.user && platform.session.user.email){
	    var email = platform.session.user.email;

        platform.api.get(url + email, null, function(body, response) {
            event.response.content.extra_data = {
              JSON.parse(body)
            };
        
            event.response.content_changed = true;
        });
    };
}

Any clues?

Thanks!


#2

Hi,

I think I might have the same issue.
When activating event script on user.session.post.post_process I get this error: “strpos() expects parameter 1 to be string, array given”. (error here)
Did you solved your problem?

Gabriel