-
-
Notifications
You must be signed in to change notification settings - Fork 831
Poll for email validation once the validation email has been sent #223
Conversation
…d 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented in the code
lgtm I guess |
Poll for email validation once the validation email has been sent
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