Merge pull request #679 from matrix-org/luke/rts-email-verif-referrer

Set referrer qp in nextLink
This commit is contained in:
Luke Barnard 2017-02-08 22:05:49 +00:00 committed by GitHub
commit 449519dc32
3 changed files with 12 additions and 0 deletions

View file

@ -91,6 +91,10 @@ class Register extends Signup {
this.params.idSid = idSid;
}
setReferrer(referrer) {
this.params.referrer = referrer;
}
setGuestAccessToken(token) {
this.guestAccessToken = token;
}

View file

@ -136,6 +136,11 @@ class EmailIdentityStage extends Stage {
"&session_id=" +
encodeURIComponent(this.signupInstance.getServerData().session);
// Add the user ID of the referring user, if set
if (this.signupInstance.params.referrer) {
nextLink += "&referrer=" + encodeURIComponent(this.signupInstance.params.referrer);
}
var self = this;
return this.client.requestRegisterEmailToken(
this.signupInstance.email,

View file

@ -98,6 +98,9 @@ module.exports = React.createClass({
this.registerLogic.setRegistrationUrl(this.props.registrationUrl);
this.registerLogic.setIdSid(this.props.idSid);
this.registerLogic.setGuestAccessToken(this.props.guestAccessToken);
if (this.props.referrer) {
this.registerLogic.setReferrer(this.props.referrer);
}
this.registerLogic.recheckState();
if (