I solved it by myself.
Step 1, Define a custom route.
(new Extend\Frontend('forum'))
->route('/signup', 'nodeloc_signup')
->route('/signup/{doorkey}', 'nodeloc_signup_invite'),
Step 2, Extend SignUpModal
extend(app.routes, 'nodeloc_signup', {
path: '/signup',
component: SignupPage
});
extend(app.routes, 'nodeloc_signup_invite', {
path: '/signup/:doorkey',
component: SignupPage
});
extend(SignUpModal.prototype, 'fields', function (fields) {
const isOptional = app.forum.data.attributes['fof-doorman.allowPublic'];
const placeholder = isOptional
? app.translator.trans('fof-doorman.forum.sign_up.doorman_placeholder_optional')
: app.translator.trans('fof-doorman.forum.sign_up.doorman_placeholder');
this.doorkey = Stream(app.doorkey) || Stream('');
fields.add(
'doorkey',
<div className="Form-group">
<input className="FormControl" name="fof-doorkey" type="text" placeholder={placeholder} bidi={this.doorkey} disabled={this.loading} />
</div>
);
});
Step 3, Now I can use the referral link this: https://www.nodeloc.com/signup/1OVUOXDWCW3OC4
Finished. 😉