Invited (future) users can't register
Here is my issue.
ubuntu : 14.04.3 LTS
nginx : 1.4.6
nodebb v0.8.2 (fresh clean install)
- list itemnodebb-plugin-emailer-local 0.2.1 OR list itemnodebb-plugin-emailer-mandrill 0.2.4, same issue (same bihavior).
- nodebb-plugin-newuser-invitation 0.2.0
Forum seems to run ok, I have no error on console (running in dev mode).
Only one user , me , as Administrator.
I have set the user registration policy to : Restrict forum registration to invited users only.
So, no one can register unless I send them an invitation.
If I do so , sending a mail to friends ... console display the followin :
16/9 23:50  - info: [emailer.smtp] Sent
undefinedemail to uid undefined
But the mail is sent. Once my friends click on the link (http://mydomain.com/register) from the mail to register, the get to an error page : Internal error /register
console error :
16/9 23:54  - error: /register
at Object.User.verifyInvitation (/var/www/html/nodebb/src/user/invite.js:59:20)
at async.waterfall.plugins.fireHook.postData.content (/var/www/html/nodebb/src/controllers/index.js:110:10)
at fn (/var/www/html/nodebb/node_modules/async/lib/async.js:717:34)
at Object.async.waterfall (/var/www/html/nodebb/node_modules/async/lib/async.js:681:44)
at Controllers.register (/var/www/html/nodebb/src/controllers/index.js:107:8)
at Layer.handle [as handle_request] (/var/www/html/nodebb/node_modules/express/lib/router/layer.js:95:5)
NOTE : I I use the same link with my already registered user (Administrator), it brings me to my profile page.
Any Help is welcome.
The url in the email should have the email and a token in the query params. Is that not the case?
You seem to be using my plugin as well as the NodeBB core invite-only functionality. Is this the case? If so, change the invite policy on NodeBB to allow normal registration and it should work.
@yariplus , in fact allowing normal registration is not an option for me , it is not what I want to do. But I've tried and the issue remaisn the same.
@all In fact I noticed something interesting, by getting the 'real' URL sent in the mail (by checking the property of the link)
Note the mandrillapp.com ...
is there any relation with the plugin : nodebb-plugin-emailer-mandrill ?? (which is not activated)
Anyways, even when mandrill plugins is activated I get the same issue...
Sorry, I think you may have misunderstood me.
My plugin nodebb-plugin-newuser-invitation is not compatible with NodeBB's Invite-only mechanic. You cannot have both turned on.
If you want to use NodeBB's native invite-only mechanic, uninstall my plugin and use the invite button in the users page, or if you want to use my plugin, turn Registration type to Normal in "Settings -> User -> Authentication" and in "Plugins -> User Invitations" check the box "Restrict forum registration to invited users only." and use the form there to send invites.
But registration will not work if both of these are turned on.
Thanks for your answer,
I uninstalled the plugin, went to user section from the forum.
And when I click on the green button : Invite nothing happen...
Even not an error in logs, it's like the button does nothing at all...
Want to be sure ... this green invite button is to invite someone to be member of the forum ?
Not to invite a member to a group right ?
@sfchun Yep, that's the right button. Hmm, I tested it and it worked for me. No error in the browser console either?
I have one error that comes when the main page is loaded :
WebSocket connection to 'ws://mydomain.com/socket.io/?EIO=3&transport=websocket&sid=f7lp9ue1TJNpSNzkAAAS' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED
But other than this one no error reported, no error when I click on : invitation
Answer found !
Invitation button in user tab is NOT working if the theme is not the default one.
- nodebb-theme-persona (default) : Ok
- nodebb-theme-vanilla : Fails
- nodebb-theme-lavender : Fails
And now mail is sent to the user , but link from the mail point to : localhost:4567 ...
Oh, yeah, I see it. Vanilla and Lavender have the component misspelled. XD
@yariplus I will fix that now
@sfchun What do you have in your config.json for url?
localhost:4567 was in url field in config.json
I modified manually to mydomain.com, restarted nodebb... since then it is impossible to login anymore...
Even reverting back to localhost:4567 does not help ... -_-;
Hmm, I'm not sure, maybe check that there isn't a second instance running somehow, maybe restart nginx.
I've try everything, even clean install from scratch.
each time I modify the url in config.json right after, any attempt to access the forum is rejected.
reverting to the old reference change nothing...
18/9 20:01  - error: /login
invalid csrf token
Try clearing you browser cache/cookies?
Ok right , it works now.
- Keep default theme until others are fixed to allow invitation to people.
- modify url from localhost to mydomain.com in config.json solved the 'wrong url' send by mail
after this ,
- clearing cache in browser will avoid having invalid csrf token error.
Do you have an idea on when the themes will be fixed ?
and how to update them ?
Was wondering if : git pull is necessary before doing : ./nodebb upgrade ?
FYI, to install/upgrade a package directly from github: (You don't typically want to ever do this)
npm i git+https://github.com/NodeBB/nodebb-theme-vanilla.git
"git pull" updates NodeBB, "./nodebb upgrade" updates its dependent packages.
Thanks a lot for updating, and information !