Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. prabez
    3. Posts
    P
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Groups 0

    Posts made by prabez

    • RE: Missing csrf token

      @baris Probably I got the problem (or rather problems).

      1. Homepage for my forum is set to custom page based on plugin:
        https://github.com/NodeBB-Community/nodebb-plugin-custom-pages
        Sadly it looks that it's missing applying csrf token, so in the situation when custom page is loaded first - each next loaded dynamically (without page refresh) will be without csrf token (until user refresh forum on other page, like topic or categories).

      2. It could be easier to catch, but in my case there was also that my file upload was in the custom plugin with own route. And I was creating it like:

      router.get('/groups/:slug/lesson/:lessonId/:name', middleware.buildHeader, lessonController.render);
      router.get('/api/groups/:slug/lesson/:lessonId/:name', lessonController.render);
      

      instead of using helper:

      const routesHelpers = require.main.require('./src/routes/helpers');
      
      routesHelpers.setupPageRoute(app, '/groups/:slug/lesson/:lessonId/:name', middleware, [], lessonController.render);
      

      It would be great if you can confirm that nodebb-plugin-custom-pages really could make the trouble, thanks!

      posted in NodeBB Development
      P
      prabez
    • Missing csrf token

      After update NodeBB to version 1.14.2 I have problems with the missing csrf_token in the client js scripts. It's used for ajax submits when uploading a files: 'x-csrf-token': config.csrf_token. Token is set in apiController.loadConfig.

      The problem is related to the merge made by @barisusakli https://github.com/NodeBB/NodeBB/pull/8367/commits

      For some reason added middleware.applyCSRF is not worked as it should be and csrf token is not applied to the config (missing in the req).

      After revert the code to the state before this changes - it's working.

      I don't know if this is a bug or just a situation related to my forum/nginx (test env)/apache (prod env) configuration.

      Can I ask about help to solve this issue? Let me know if I can provide any additional logs/details related to the case. Thanks!

      barisusakli created this issue in NodeBB/NodeBB

      closed feat: add buildHeaderAsync #8367

      posted in NodeBB Development
      P
      prabez
    • RE: Setting up a local environment of nodebb causes some weird errors from dbsearch

      Hi, I want to report that I have the same error as the author of this topic. I just have started maintencance of NodeBB forum and I wanted to upgrade it to the newest version. I did every step from upgrade guide, but unfortunatelly error occurs when I was trying to update forum with "upgrade" command.

      When I was searching solution to my problem I found this commit https://github.com/NodeBB/NodeBB/commit/6f1fb4eb246f035c329ff361ed2cf145e3936335 and this topic https://github.com/barisusakli/nodebb-plugin-dbsearch/issues/49

      So everything pointed to added line "require('../../require-main');" as the cause of the problem (in file src/cli/index.js). I moved it to upgrade.js file, before the upgradePlugins require and everything works.

      dangerusslee created this issue in barisusakli/nodebb-plugin-dbsearch

      closed Changing dbsearch mongodb search schema to use _id fails #49

      0 barisusakli committed to NodeBB/NodeBB
      fix: #https://github.com/barisusakli/nodebb-plugin-dbsearch/issues/49
      posted in Technical Support
      P
      prabez