Referrer doesn't redirect?
-
Re: Redirect after register/registration
In my theme I try to accomplish this like so:
library.redirectAfterRegistration = (data, callback) => { user.getUserData(data.uid, (err, userdata) => { if (err) { return callback(err); } const url = nconf.get('relative_path') + '/user/' + encodeURIComponent(userdata.userslug); data.referrer = url; callback(null, data); }); };
Any idea why it's not working? The referrer looks good '/user/[username]'.
-
It receives the referrer but only after the first step, not after GDPR and ToS. I'm running version
1.12.1
. -
A related question. If I need to redirect the logged in user to their profile because I need them to fill in a field, how would I go about doing that?
At the moment I catch the hook
filter:middleware.render
and do ares.redirect('/user/[username]/edit')
. It works great on initial render, but when I try to click somewhere the main area just goes blank.I believe it has to do with the api call being made to re-render the page. I am not familiar enough with the inner workings to know why this is happening.
-
@magnusvhendin I filed a bug for this, https://github.com/NodeBB/NodeBB/issues/8050
Will need to be fixed in core.