• Home
  • Categories
  • Recent
  • Popular
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Default
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Quartz
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Slate
  • Solar
  • Superhero
  • Vapor
Collapse

Community

G

genesisx

@genesisx
About
Posts
14
Topics
3
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

    RE: Excessive "invalid csrf token" on Login and Register
  • G genesisx

    @genesisx said in Excessive "invalid csrf token" on Login and Register:

    @baris Hi, users were seeing a "Forbidden" plain text page while log shows "invalid csrf token".

    Actually I think this could be the issue, I just reproduced the error with JavaScript turned off in Chrome...the "no script" warning template is not using translation syntax, which is something could be easily fixed.

    Thank you so much baris! I've been scratching my head to reproduce the issue, just didn't really come to me that someone would have js turned off in their browser...(and geez there are quite a lot of them)

    @baris not so easy I guess...some users with js turned on still seeing the "Forbidden" page upon registration, I will need to get a hold on someone who can reproduce the error and report on this. It's just so abnormally often that I start to suspect it could be GFW..


  • RE: Excessive "invalid csrf token" on Login and Register
  • G genesisx

    @hariom-vashisth thanks for reply, I will try your settings


  • RE: Excessive "invalid csrf token" on Login and Register
  • G genesisx

    @baris Hi, users were seeing a "Forbidden" plain text page while log shows "invalid csrf token".

    Actually I think this could be the issue, I just reproduced the error with JavaScript turned off in Chrome...the "no script" warning template is not using translation syntax, which is something could be easily fixed.

    Thank you so much baris! I've been scratching my head to reproduce the issue, just didn't really come to me that someone would have js turned off in their browser...(and geez there are quite a lot of them)


  • RE: Excessive "invalid csrf token" on Login and Register
  • G genesisx

    @phit Hi, thanks for reply, I've actually tried both, right now it is set to www.moefi.com, before it was blank, having errors in both case.


  • RE: Excessive "invalid csrf token" on Login and Register
  • G genesisx

    @yariplus The issue still presents after changing the settings...could you advice where I can put some print statement so that there will be more information to find the exact issue?

    23/6 10:11:20 [3644] - ^[[32minfo^[[39m: NodeBB is now listening on: 0.0.0.0:4567
    23/6 12:40:34 [3644] - ^[[31merror^[[39m: /login                              invalid csrf token
    23/6 12:40:43 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    23/6 12:40:54 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    23/6 12:41:01 [3644] - ^[[31merror^[[39m: /login                              invalid csrf token
    23/6 12:41:17 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    23/6 12:41:26 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    23/6 12:43:14 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token                                                          23/6 17:32:37 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token                                                          23/6 17:33:46 [3644] - ^[[31merror^[[39m: /login
    23/6 17:33:46 [3644] - ^[[31merror^[[39m: /login                              invalid csrf token
    23/6 17:34:09 [3644] - ^[[31merror^[[39m: /login                              invalid csrf token
    23/6 17:34:24 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    23/6 17:34:34 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    23/6 17:34:53 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    24/6 01:33:46 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    24/6 01:33:55 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    24/6 01:34:34 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    24/6 01:34:36 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    24/6 01:35:32 [3644] - ^[[31merror^[[39m: /login
     invalid csrf token
    24/6 05:42:10 [3644] - ^[[31merror^[[39m: /register
     invalid csrf token
    24/6 07:55:34 [3644] - ^[[31merror^[[39m: /register
     invalid csrf token
    24/6 09:27:22 [3644] - ^[[31merror^[[39m: /register
     invalid csrf token
    24/6 09:27:48 [3644] - ^[[31merror^[[39m: /register
     invalid csrf token
    24/6 09:35:00 [3644] - ^[[31merror^[[39m: /register
     invalid csrf token 
    

  • RE: Excessive "invalid csrf token" on Login and Register
  • G genesisx

    @yariplus thanks! I thought that is only referenced locally. I've changed to https and will see if it fix the issue.


  • Excessive "invalid csrf token" on Login and Register
  • G genesisx

    Hi, we have a forum instance running for Chinese users, 1 out of 4 users is having trouble registering or loginin, instead of seeing the red error prompt box on that page, they got redirected to a plain text page showing "Forbidden", even after cleaning their cookies, this happens on varies browsers including chrome, edge, ie, also some Chinese browser such as UC. I've searched through the forum and tried any config but no luck. Please give advice.
    Below are the setup and config files I have

    Ubuntu 16.10
    Nodebb version 1.5.1
    Mongodb 2.6.11
    Nginx 1.12.0

    Nginx config

    server {
        listen 80;
        server_name www.moefi.com;
    
        return 302 https://$server_name$request_uri;
    
    }
    
    ### the https server
    server {
        # listen on ssl, deliver with speedy if possible
        listen 443 ssl spdy;
    
        server_name www.moefi.com;
    
        # change these paths!
        ssl_certificate /etc/some.pem;
        ssl_certificate_key /etc/some.key;
    
        # enables all versions of TLS, but not SSLv2 or 3 which are weak and now
    deprecated.
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    
        # disables all weak ciphers
        ssl_ciphers 'AES128+EECDH:AES128+EDH';
    
        ssl_prefer_server_ciphers on;
    
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://127.0.0.1:4567;
            proxy_redirect off;
            
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    

    Nodebb config

    {
        "url": "http://www.moefi.com",
        "secret": "secret",
        "database": "mongo",
        "port": 4567,
        "mongo": {
            "host": "127.0.0.1",
            "port": "27017",
            "username": "something",
            "password": "something",
            "database": "nodebb"
        }
    }
    

    Error

    20/6 09:47:18 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    20/6 18:14:28 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    21/6 06:31:10 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 06:31:13 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 06:31:23 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 06:31:33 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 06:31:48 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 06:31:52 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 06:32:11 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 06:33:34 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token                                                          21/6 08:45:27 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    21/6 10:25:07 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 11:17:21 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    21/6 11:19:13 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    21/6 11:21:10 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    21/6 11:27:41 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    21/6 11:28:35 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    21/6 11:47:46 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    21/6 11:48:58 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 11:49:09 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 11:49:57 [6838] - ^[[31merror^[[39m: /login
     invalid csrf token
    21/6 11:54:16 [6838] - ^[[31merror^[[39m: /register
     invalid csrf token
    

  • RE: [nodebb-plugin-ns-points] NS Points, Forum Gamification
  • G genesisx

    @genesisx said in [nodebb-plugin-ns-points] NS Points, Forum Gamification:

    Hey there, thanks for the great plugin, seems like it's not compatible with 1.5.x, any chance it will be compatible in the future?

    Alright, looks like it's a simple hook change, here is the pull request.
    https://github.com/NicolasSiver/nodebb-plugin-ns-points/pull/9


  • RE: [nodebb-plugin-ns-points] NS Points, Forum Gamification
  • G genesisx

    Hey there, thanks for the great plugin, seems like it's not compatible with 1.5.x, any chance it will be compatible in the future?


  • RE: Save Nested Object or Array Into Topic Data
  • G genesisx

    @baris literally saved my day 👍
    BTW, is there a way to tell the client side code to refresh the page inside an action hook, say action:topic.reply?


  • Save Nested Object or Array Into Topic Data
  • G genesisx

    Hi community, I am writing a plugin that I want to keep track of a list of users who have replied to a certain topic.

    I wanted to create a list of uids that replied (or object with uid as key and post count inside the topic as value) in the topic data object.

    However when I tried to do it like this

    plugin.createReplyList = function(topicData) {
    	var replyList = [1,2,3]
    
    	db.setObjectField('topic:' + topicData.tid, "replyList", replyList);
    };
    

    I got the below error

    node_redis: Deprecated: The HSET command contains a argument of type Array.
    This is converted to "1,2,3" by using .toString() now and will return an error from v.3.0 on.
    Please handle this in your code to make sure everything works as you intended it to.
    
    

    Wonder what would be the correct way to achieve this? Thanks in advance.


  • RE: Helper function not working at initial page load
  • G genesisx

    @PitaJ Found a syntax error after looking carefully at the server side code, thanks for pointing out the problem is at server side...thought I copy pasted it! Thanks again! 😄


  • RE: Helper function not working at initial page load
  • G genesisx

    @PitaJ Thanks, I will try this tonight, is library.init the right place to register a helper function? I also tried to put it in appLoad hook , got same behavior.


  • Helper function not working at initial page load
  • G genesisx

    Hi community, I am working on customizing the persona theme, and I need to override the generateChildrenCategories helper that comes with NodeBB. I successfully overrode the function and it's rendering my customized subcategories.

    BUT it only works if I click on any of the links that take me to /category . If I refresh the page, the helper function does not work (not called or not yet initialized I guess), it renders no subcategory icon at all. Same happens when first landing at the forum as well.

    Here is my code
    library.js

    library.init = function(params, callback) {
    	...
    	templates.registerHelper('myGenerateChildrenCategories', function (category) {
    		...
                    return html;
    	};
    
    	callback();
    };
    

    persona.js

    $(document).ready(function() {
            ...
            templates.registerHelper('myGenerateChildrenCategories', function (category) {
    		...
                    return html;
    	};
            ...
    }
    

    item.tpl

    <!-- IF !config.hideSubCategories -->
    {function.myGenerateChildrenCategories}
    <!-- ENDIF !config.hideSubCategories -->
    
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
  • Login

  • Don't have an account? Register

  • Login or register to search.