SteveMcArthur / docpad-plugin-authentication

Handles authentication and login functionality via social login for your docpad application. Protects pages from unauthenticated users. Uses the node module social-login (https://github.com/26medias/social-login) to standardise the configuration interface to the various login strategies and handle routing and redirection.
http://login-stevehome.rhcloud.com
Other
4 stars 1 forks source link

req.body undefined when posting back to server #12

Closed SteveMcArthur closed 7 years ago

SteveMcArthur commented 7 years ago

This especially happens when creating a new user account by posting back to the serverCreateAccount url. You may also get the message[TypeError: Cannot read property 'NickName' of undefined]. This seems to occur when forceServerCreation is set to true and the plugin manually creates the server. My suspicion is that this is because the plugin is creating the server and applying its routes BEFORE docpad initiates the express bodyParser - whereas the bodyParser needs to be applied first, before all routes are applied. http://stackoverflow.com/questions/9177049/express-js-req-body-undefined