Version 2.8.2: Unable to register or login

Solved Technical Support
  • Fairly new to NodeBB. Just got one site up with PostgreSQL as the backend.

    Initially version 1.5.1 was installed which has been upgraded to ver 2.8.2 a few days ago.

    It is still running in dev mode, so I only got one user registered from the initial installation. Now I am not able to register any new user.

    Every time I try, I get an error message:
    Registration Error
    We were unable to log you in, likely due to an expired session. Please try again

    On the console, I see logs like this:
    2023-01-24T06:51:40.275Z [4567/73890] - error: POST /register
    invalid csrf token

    At this point, I don't know how to proceed. Any help would be greatly appreciated.

  • GNU/Linux

    Most likely you don't need cookie domain..
    What is your config.json url value, and does it match your site URL?

    Are you using nginx? Check the headers to see if you have proxy_set_header X-Forwarded-Proto $scheme;

  • Global Moderator Plugin & Theme Dev

    Have you tried clearing cookies?

  • @ww9rivers this is for MongoDB, but along the same lines

  • @PitaJ - Yes, I have. Tried different browsers, private windows, etc. No luck.

    @phenomlab - I think the cookieDomain setting may be what I need. Could you please be more specific? Do I need to clear that setting (as shown in your linked post)? Or set it specifically to my domain? I ask because the current setting seems to be empty (not set to anything.)

    Thank you both for your responses.

  • @ww9rivers It needs to be executed against the production database you are using - however, the code provided is for MongoDB, so I am almost positive there will be an alternative you'd need to use for Postgres. Perhaps @baris or @julian can assist with this part.

  • GNU/Linux

    Most likely you don't need cookie domain..
    What is your config.json url value, and does it match your site URL?

    Are you using nginx? Check the headers to see if you have proxy_set_header X-Forwarded-Proto $scheme;

  • @julian : That did it! Thank you much.

    Yes. I use nginx -- I should have mentioned that in the original post.

    That option was set to proxy_set_header X-Forwarded-Proto http;

  • W ww9rivers has marked this topic as solved
  • GNU/Linux

    @ww9rivers no problem 👍 I threw myself at that one for far longer than I'd care to admit, so if it saves someone the headache, it's worth it.

  • Thank you all for the responses. This is a wonderful community - Makes me feel much better exploring this new thing.

    Wishing you all the best!


Suggested Topics

| | | |