Skip to content

UX bug causing error after login #18

Description

@Gwillison415
app.use((req, res, next) => {
  console.log('res.locals.user', res.toString(), 'req.session.passport', req.session.passport);
  res.locals.user = req.user;
  next();
});

not positive what this code is used for besides the obvious passing of user info from request to response object. What I do know is that the res.locals is a function function () { [native code] } and it cannot be coerced to a string.

possible causes:

  • asynchronous call is returning error before data resolves - such that 'map is not a function'
  • placement /order of app.use's
  • not a saved session via the 'express-session' middleware (however I see a proper session w/ sessionID)
  • possibly not calling deserializeUser #45
  • res does not include a user except in the graphql query and the raw JSON from res.MemoryStore

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions