Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Poll for email validation once the validation email has been sent #223

Merged
merged 2 commits into from
Mar 17, 2016

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Mar 16, 2016

Continue with the registration process if/when it succeeds.

Fixes element-hq/element-web#1027
Requires matrix-org/synapse#650 and matrix-org/synapse#649

@@ -200,7 +207,7 @@ class Register extends Signup {
return stage.complete().then(function(request) {
if (request.auth) {
console.log("Stage %s is returning an auth dict", stageName);
return self._tryRegister(request.auth);
return self._tryRegister(request.auth, request.poll_for_success);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there's an awful lot of stuff which isn't specced at all here. Do you have plans to spec this at some point?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's nothing special about this, spec-wise: 3pid UI auth works by the validation being done out of band, at which point you retry the auth the get the HS to check the validation has been done: this just takes advantage of the fact that you can retry the auth safely without knowing if the validation has completed, since it will keep 401ing if it hasn't.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example, we rely on the body of the 401 having certain fields. That certainly isn't specced anywhere.

@richvdh
Copy link
Member

richvdh commented Mar 17, 2016

Looks plausible, although my understanding of the 3pid registration process is weak to non-existent.

return self.startStage(flowStage);
if (error.httpStatus === 401) {
if (error.data && error.data.flows) {
self.params.sessionId = error.data.session;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does the session id change when we get a 401?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented in the code

@richvdh
Copy link
Member

richvdh commented Mar 17, 2016

lgtm I guess

@richvdh richvdh assigned dbkr and unassigned richvdh Mar 17, 2016
dbkr added a commit that referenced this pull request Mar 17, 2016
Poll for email validation once the validation email has been sent
@dbkr dbkr merged commit 577a7e3 into develop Mar 17, 2016
@richvdh richvdh deleted the dbkr/poll_for_email_validation branch February 15, 2017 13:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants