Quantcast
Channel: DreamFactory Forum - Latest topics
Viewing all articles
Browse latest Browse all 1523

NodeJS post_process scripting for user/session example - Error 500

$
0
0

@flpozzato wrote:

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!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 1523

Trending Articles